File Transfer Protocol, FTP
Image Caption: Illustrates the FTP connection between a Client and a Server, using the PASV command. Credit: Michael Lorer/Wikipedia (CC BY-SA 3.0)
File transfer protocol (FTP) is the protocol of transferring files from one host to another host usually over the Internet. This protocol is normally done by authentication by the user entering a username and password. However, some servers (hosts) allow anonymous connection, which in most cases allows limited access to the site.
The first FTP applications were called command-line applications that were developed before computers used graphical user interfaces (GUIs). The later FTP applications shipped with most operating systems still use the command-line concept but is integrated other applications on the PC.
The original FTP was published on April 16 1971, and replaced in June 1980. The current protocol was released in October 1985. Updates to the current FTP were done in June 1997 with security extensions, and in September 1998 with IPv6 support.
An FTP runs in two modes, either active or passive; this determines how a data connection is established. In the active mode, the client creates a TCP connection to the server and sends the server an IP address and waits until the server initiates the connection. In this mode, file transfer can sometimes be blocked by a firewall, and files will not be transferred. It that case the passive mode is sometimes used. In the passive mode the client uses a controlled connection with a PASV command and then receives the IP address for the server.
Modes used in the transfer of data over a network:
ASCII mode: This mode is used for text file transfers.
Binary mode: This mode sends files one byte at a time and the receiving host stores the bytes as it receives them.
EBCDIC mode: This mode is similar to ASCII and is used for text file transfers.
Local mode: This mode allows two computers with identical setups to send data without converting to ASCII.
Stream mode: Data is sent in a continuous stream.
Block mode: FTP breaks up the data into blocks and then passes it to the TCP.
Compressed mode: The data is compressed for transfer.
Most browsers support FTP and transfer files in PASV.
FTP is unable to encrypt data such as usernames, passwords, and commands. This data is transferred as text and can be read easily. To send data securely, FTPS is a secure data transfer protocol that does encrypt the data.