The two types of Connections in FTP are as follows −
There are two steps −
The connection remains open during the whole process.
The data connection facilitates the well-known port 20 at the server site. The following steps display how FTP creates a data connection.
FTP uses a similar approach as TELNET or SMTP to communicate across the control connection. It uses the NVT ASCII character set. Communication is achieved through command and responses. Each command or response is only one short line; therefore, we need not worry about file format or file structure.
In this, the client must define the type of file to be transferred via transmission mode. Before sending the document through the data connection, we arrange for transmission through the control connection.
The heterogeneity problem is resolved by representing three attributes of communication.
So, the sender must determine the following attributes of the file.
The file to be transferred can be ASCII, EBCDIC or Image file. If the file has to be shared as ASCII or EBCDIC, the destination should be ready to accept it in that mode. The third type is used if the file is to be transferred without any notice to its content. Thus third and last Type-Image file is a misnomer. It has nothing to do with images. It implies a binary file that is not interpreted by FTP in any manner and sent as compiled programs are examples of image files.
FTP can change a file across connections by interpreting its structure in the ways, and the structure can be byte-oriented structure and Record oriented structure.
FTP can transfer a file using one of the three transmission modes described here.