FTP is an application layer protocol

FTP protocol (File Transfer Protocol File Transfer Protocol) to work in the application layer TCP / IP reference model, is based on a protocol of the TCP transport protocol. Like most Internet services, FTP is a client / server system, the FTP protocol includes two important components, FTP server and FTP client. FTP file server for storing and transmitting, by the user using the FTP client and FTP protocol server transmits the resource or access files located on the server.

An FTP server process can simultaneously serve multiple client processes. FTP Server process consists of two parts: a main process, responsible for receiving a new request; a plurality of additional slave process, responsible for processing a single request.

 

 

Main process steps of receiving a new request is:

1, port 21 is opened in the server, the connection of the control link open;

2, the server waits for the client process makes a connection request, the client opens a temporary port for the data connection;

3, the server receives a connection request and a response, or other opening 20 is greater than the number of the port for the data connection 1024, and to establish a data connection;

4, the server start request slave process to handle the client process is given;

5, after the process of the slave client process is processed, the client sends a request to close the connection, after termination of the file transfer server in response;

6, the server returns to the wait state, continue to accept requests sent by other processes.

It should be noted that the processing of the main process and slave process is carried out concurrently.

FTP supports two modes of operation, called Port mode (active mode), the other is Passive mode (passive mode). In the active mode, the client now No. 21 FTP server port to establish a connection, transmission Port command, and open the number a random port and the server port 20 for sending and receiving data; and in the passive mode, the client sends not Port Passive command but a command, and the server with the client data connection is open when a port number is greater than 1024, the port 20 is no longer determined. Due to lower Passive mode is enabled on the server side is an arbitrary port, firewall settings do not allow a lot of time to receive external connections initiated, so many firewalls or network FTP server does not support the Passive mode.

For up an FTP server, you can usually use the Server U software; and for FTP client, we can directly use a simple browser, of course, you can use specialized software, such as CuteFTP, FlashFTP, FTP Explorer and so on.

 

Guess you like

Origin www.cnblogs.com/HuangJiaPing/p/12510652.html