0% found this document useful (0 votes)
33 views4 pages

Objectives of FTP: Port Number 21

Uploaded by

spartansheik
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)
33 views4 pages

Objectives of FTP: Port Number 21

Uploaded by

spartansheik
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/ 4

FTP

 FTP stands for File transfer protocol.


 It is an application layer protocol.
 It runs on the top of TCP, like HTTP.
 FTP is a standard internet protocol provided by TCP/IP used for transmitting the files from one host to another.
 It is mainly used for transferring the web page files from their creator to the computer that acts as a server for
other computers on the internet.
 It is also used for downloading the files to computer from other servers.

Objectives of FTP

 It provides the sharing of files.


 It is used to encourage the use of remote computers.
 It transfers the data more reliably and efficiently.

Mechanism of FTP

The above figure shows the basic model of the FTP.

 The FTP client has three components:


 The user interface, control process, and data transfer process.
 The server has two components:
 The server control process and the server data transfer process.

There are two types of connections in FTP:

Control Connection:
 The control connection uses very simple rules for communication.
 Through control connection, we can transfer a line of command or line of response at a time.
 For sending control information like user identification, password, commands to change the remote directory,
commands to retrieve and store files, etc., FTP makes use of control connection.
 The control connection is initiated on port number 21.
 The control connection is made between the control processes. The control connection remains connected during
the entire interactive FTP session.

Data Connection:
 The Data Connection uses very complex rules as data types may vary.
 The data connection is made between data transfer processes.
 The data connection opens when a command comes for transferring the files and closes when the file is
transferred.
 For sending the actual file, FTP makes use of data connection.
 A data connection is initiated on port number 20.

FTP Clients

 FTP client is a program that implements a file transfer protocol which allows you to transfer files between two
hosts on the internet.
 It allows a user to connect to a remote host and upload or download the files.
 It has a set of commands that we can use to connect to a host, transfer the files between you and your host and
close the connection.
 The FTP program is also available as a built-in component in a Web browser. This GUI based FTP client makes
the file transfer very easy and also does not require to remember the FTP commands.

FTP Session

 When a FTP session is started between a client and a server, the client initiates a control TCP connection with the
server side.
 The client sends control information over this.
 When the server receives this, it initiates a data connection to the client side.
 Only one file can be sent over one data connection.
 But the control connection remains active throughout the user session.
 As we know HTTP is stateless i.e. it does not have to keep track of any user state. But FTP needs to maintain a
state about its user throughout the session.

Data Structures : FTP allows three types of data structures :

 File Structure – In file-structure there is no internal structure and the file is considered to be a continuous
sequence of data bytes.
 Record Structure – In record-structure the file is made up of sequential records.
 Page Structure – In page-structure the file is made up of independent indexed pages.

FTP defines three different transmission modes (also called transfer modes)

 Specify exactly how data is sent from one device to another over an opened data channel:
 Stream mode
 Block mode
 Compressed mode.

1. Stream Mode

 In this mode, data is sent simply as a continuous stream of unstructured bytes.


 The sending device simply starts pushing data across the TCP data connection to the recipient.
 No message format with distinct header fields is used, making this method quite different from the way many
other protocols send information in discrete chunks.
 It relies strongly on the data streaming and reliable transport services of TCP.
 Since there is no header structure, the end of the file is indicated simply by the sending device closing the data
connection when it is done.
 Of the three methods, stream mode is the one that is by far the most widely used in real FTP implementations.

2. Block Mode

 Block mode transforms data from one host to another in the form of blocks.
 Each block is preceded by a 3-byte header.
 The first byte contains all the information about the block hence knows for the description block.
 Other two blocks containing the size of the block in the form of bytes.

3. Compressed Mode

 Compress mode is used in the case of big file size.


 If the file size is big, it cannot send over the internet connection because of the size limit.
 In Compressed mode, a large file is compressed into a small size and then sends over the internet.

Types of FTP Transfers


It can transfer the following file types across internet connections.

1. ASCII file

 This is the default format for transforming a file from one to another.
 Each character is encoded by NVT ASCII, i.e. Network Virtual Terminal ASCII character set.
 Both the sender and the receiver transform their file from its own representation into NVT ASCII.

2. EBCDIC

 If sender or receiver connections use the EBCDIC encoding method, then for transforming files, FTP uses
EBCDIC encoding.

3. Image File

 For transforming the binary file, the image file is the default mode.
 The file is transformed over the internet connections in the form of stream bits without encoding.

FTP Commands – Some of the FTP commands are


 USER – This command sends the user identification to the server.
 PASS – This command sends the user password to the server.
 CWD – This command allows the user to work with a different directory or dataset for file storage or retrieval
without altering his login or accounting information.
 RMD – This command causes the directory specified in the path-name to be removed as a directory.
 MKD – This command causes the directory specified in the pathname to be created as a directory.
 PWD – This command causes the name of the current working directory to be returned in the reply.
 RETR – This command causes the remote host to initiate a data connection and to send the requested file over
the data connection.
 STOR – This command causes to store a file into the current directory of the remote host.
 LIST – Sends a request to display the list of all the files present in the directory.
 ABOR – This command tells the server to abort the previous FTP service command and any associated transfer
of data.
 QUIT – This command terminates a USER and if file transfer is not in progress, the server closes the control
connection.
FTP Replies – Some of the FTP replies are
 200 Command okay.
 530 Not logged in.
 331 User name okay, need a password.
 225 Data connection open; no transfer in progress.
 221 Service closing control connection.
 551 Requested action aborted: page type unknown.
 502 Command not implemented.
 503 Bad sequence of commands.
 504 Command not implemented for that parameter.

Advantages of FTP
 Speed: One of the biggest advantages of FTP is speed. The FTP is one of the fastest way to transfer the files from
one computer to another computer.
 Efficient: It is more efficient as we do not need to complete all the operations to get the entire file.
 Security: To access the FTP server, we need to login with the username and password. Therefore, we can say that
FTP is more secure.
 Back & forth movement: FTP allows us to transfer the files back and forth. Suppose you are a manager of the
company, you send some information to all the employees, and they all send information back on the same server.

Disadvantages of FTP:

 The standard requirement of the industry is that all the FTP transmissions should be encrypted. However, not all
the FTP providers are equal and not all the providers offer encryption. So, we will have to look out for the FTP
providers that provide encryption.
 FTP serves two operations, i.e., to send and receive large files on a network. However, the size limit of the file is
2GB that can be sent. It also doesn't allow you to run simultaneous transfers to multiple receivers.
 Passwords and file contents are sent in clear text that allows unwanted eavesdropping. So, it is quite possible that
attackers can carry out the brute force attack by trying to guess the FTP password.
 It is not compatible with every system.

Trivial File Transfer Protocol (TFTP)

 It is also file transfer protocol without sophisticated features of FTP.


 It is good for simple file transfers, such as during boot time.
 It uses UDP as transport layer protocols. Errors in the transmission (lost packets, checksum errors) must be
handled by the TFTP server.
 It uses only one connection through well known port 69.
 TFTP uses a simple lock-step protocol (each data packet needs to be acknowledged). Thus the throughput is
limited

Anonymous FTP

 Anonymous FTP is enabled on some sites whose files are available for public access.
 A user can access these files without having any username or password.
 Instead, the username is set to anonymous and password to the guest by default.
 Here, user access is very limited. For example, the user can be allowed to copy the files but not to navigate
through directories.

You might also like