The File Transfer Protocol (FTP), a file transfer standard on the Internet, runs at the application layer in the TCP/IP protocol suite. FTP is used to transfer files between local and remote hosts, typically for version upgrades, log downloads, file transfers, and configuration savings. FTP is implemented based on the file system.

FTP uses the client/server architecture, as shown in Figure 1.

Figure 1 FTP client/server architecture

The NetEngine 8000 F provides the following FTP functions:

In addition to file transfer, FTP supports interactive access, format specifications, and authentication control.

FTP provides common file operation commands to help you manage the file system, including file transfer between hosts. You can use an FTP client program outside a router to upload or download files and access directories on the router. You can also run an FTP client program on a router to transfer files to other devices or to the FTP server on the router.

FTP Connections

FTP is a standard application protocol based on the TCP/IP protocol suite. It is used to transfer files between local clients and remote servers. FTP uses two TCP connections to copy a file from one system to another. The TCP connections are usually established in client-server mode, one for control (the server port number is 21) and the other for data transmission (the server port number is 20).
  • Control connection

    A control connection is set up between the FTP client and FTP server.

    The control connection always waits for communication between the client and server. Commands are sent from the client to the server over this connection. The server responds to the client after receiving the commands.

  • Data connection

    The server uses port 20 to provide a data connection. The server can either set up or terminate a data connection. When the client sends files in streams to the server, only the client can terminate the data connection.

    FTP supports file transfer in stream mode. The end of each file is indicated by end of file (EOF). Therefore, new data connections must be set up for each file transfer or directory list. When a file is transferred between the client and server, a data connection is set up.

Figure 2 shows the process of FTP file transfer.

Figure 2 Process of FTP file transfer

Process of Setting Up an FTP Connection

The process of setting up an FTP data connection is as follows:

  1. The server passively enables port 21 to wait to set up a control connection to the client.

  2. The client actively enables a temporary port to send a request for setting up a connection to the server.

  3. After the server receives the request, a control connection is set up between the temporary port on the client and port 21 on the server.

  4. The client sends a command for setting up a data connection to the server.

  5. The client chooses a temporary port for the data connection and uses the port command to send the port number to the server over the control connection.

  6. The server actively enables port 20 to send a request for setting up a data connection.

  7. After the client receives the request, a data connection is set up between the temporary port on the client and port 20 on the server.

Figure 3 shows the FTP connection establishment process. In this example, the FTP client uses temporary port 2345 to establish a control connection and temporary port 2346 to establish a data connection. The two ports are connected to ports 21 and 20 of the FTP server, respectively.

Figure 3 FTP connection establishment process

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >