What is FTP?
FTP or file transfer protocol is a commonly used protocol for exchanging files over any network that supports the TCP/IP protocol (such as the Internet or an intranet). There are two computers involved in an FTP transfer: a server and a client. The FTP server, running FTP server software, listens on the network for connection requests from other computers. The client computer, running FTP client software, initiates a connection to the server.
Once connected, the client can do a number of file manipulation operations such as uploading files to the server, downloading files from the server, renaming or delete files on the server, and so on. Any software company or individual programmer is able to create FTP server or client software because the protocol is an open standard. Virtually every computer platform supports the FTP protocol. This allows any computer connected to a TCP/IP based network to manipulate files on another computer on that network regardless of which operating systems are involved (if the computers permit FTP access). There are many existing FTP client and server programs, and many of these are free.
While transferring data over the network, two modes can be used
- ASCII mode
- Binary mode
The two types differ in the way they send the data. When a file is sent using an ASCII-type transfer, the individual letters, numbers, and characters are sent using their ASCII character codes. The receiving machine saves these in a text file in the appropriate format (for example, a Unix machine saves it in a Unix format, and a Macintosh saves it in a Mac format). Hence if an ASCII transfer is used it can be assumed plain text is sent, which is stored by the receiving computer in its own format. Translating between text formats entails substituting the end of line and end of file characters used on the source platform with those on the destination platform, e.g. a Windows machine receiving a file from a Unix machine will replace the carriage returns with carriage return-line feed pairs. ASCII transfer is also marginally faster, as the highest-order bit is dropped from each byte in the file.
Sending a file in binary mode is different. The sending machine sends each file bit for bit and as such the recipient stores the bitstream as it receives it. Any form of data that is not plain text will be corrupted if this mode is not used.
By default, most FTP clients use ASCII mode. Some clients try to determine the required transfer mode by inspecting the file’s name or contents.
FTP is an inherently insecure method of transferring files because there is no way for the original FTP specification to transfer data in an encrypted fashion. What this means is that under most network configurations, user names, passwords, FTP commands and transferred files can be “sniffed” or viewed by someone else on the same network using a protocol analyzer (or “sniffer”). It should be noted that this is a problem common to many Internet protocols written prior to the creation of SSL such as HTTP, SMTP, and Telnet. The common solution to this problem is to use SFTP (SSH File Transfer Protocol) which is based on SSH, or FTPS (FTP over SSL), which adds SSL or TLS encryption to FTP.