What is FTP?

FTP (File Transfer Protocol) is an application layer protocol that is used to transfer files between a client and a server. The user interacts with FTP via an FTP agent.

svg viewer

Steps

The following steps are involved in transferring a file using FTP:

  1. The user provides the name of the host that it wants to connect with.

  2. The FTP client establishes a TCP connection on port 20 with the server.

  3. The user authenticates itself to the remote server.

  4. After being authenticated, the user can transfer from or to the server.

  5. The server initiates another TCP connection with the client to send a file to the user or to receive a file from the user. This connection is called a data connection.

  6. FTP closes the data connection after the file is transferred. In the case of multiple files, the server initiates a new TCP connection for every file.

Common commands

Some of the common commands used in FTP are:

  • USER username

    Used to send the username to the server.

  • USER password

    Used to send the password to the server.

  • RETR filename

    Used to get a file from the server’s current directory.

Copyright ©2024 Educative, Inc. All rights reserved