
On the client side, outbound connection on port 21/tcp should be allowed along with passive port range defined on the server. Refer to its documentation for further details. This definition process may vary based on the FTP server in use. A passive port range is defined for file transfers and directory listings and allows inbound connections. For concurrent transfer of multiple files or directory listings, multiple data channel ports are required.įTP is an inherently insecure protocol as both command and data channels transfer information in an unencrypted form, which is easily susceptible to interception by anyone using man-in-the-middle attacks.Īs earlier discussed, FTP requires an inbound connection on port 21/tcp on the server side for the command channel. Unlike the command channel, the data channel remains open only for the duration of file transfer, and as soon as it finishes, the data channel is closed. This channel is responsible for sharing actual data between server and client in the form of directory listings and file transfers. The data channel uses an on-demand temporary port listening on the server (passive mode) or the client (active mode). The command channel remains open for the whole duration of the FTP session until the client sends QUIT command or the server forcibly disconnects due to inactivity or any other possible reason. The command channel works on port 21, which accepts connections from clients and handles the passing of commands. This requires two ports for FTP to work – the command channel and the data channel.

This later evolved as RFC 959, which is the standard in use today.įTP works on two channels to exchange information: one for commands and the other for data. FTPįTP is the decades-old File Transfer Protocol originally proposed under RFC 114.

Knowing how these protocols work and the differences among these popular transfer mechanisms can help you choose which one works best for your needs. These differences relate to how data is exchanged, the level and type of security in communication, and firewall considerations. FTP or File Transfer Protocol is one of the most popular data transfer methods available for various use cases.įTP has different secure variations available, known as FTPS and SFTP, which incorporates some subtle and some not-so-subtle differences in how they work.
