Objectives of FTP: Port Number 21
Objectives of FTP: Port Number 21
Objectives of FTP
Mechanism of 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.
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
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
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.
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.
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.