FTP file transfer server principle

FTP server, the full name File Transfer Protocol Server, to provide computer access and file storage services on the Internet, they provide services in accordance with the FTP protocol. FTP, file transfer protocol (File Transfer Protocol) is a standard protocol for file transfer over the network, using a client / server model. FTP is a protocol designed to transfer files.

FTP is a client / server system, supporting a user by using the FTP protocol client connected to the server program on the remote host. The client user issues a command, the command issued by the user performing the remote host server receiving the command, and returns the execution result to the client. Simply put, a user issues a command to the server, ask the server to send a file to the user, the server responds and sends the file to the client, the user receives the file be placed in the user working directory, this process is the FTP server the exchange of documents.

FTP Servers Work

FTP service based on TCP protocol, file transfer protocol is the Internet, the default port to use two numbers 20 and 21, a data port and a command port, port 20 is a data port, between the client and the server used for file transfer data flow. Command port 21 is a port for transmission of control flow, accept the parameter FTP command sent by the client.

FTP file transfer server principle

Works shown in the FTP service. The FTP client sends in a computer network service request to the FTP server, FTP server receives the response request of the FTP client, and to provide the required service FTP file transfer client. Under the TCP protocol, FTP server 20, 21 using well-known port number to provide services, FTP client to send the request using a temporary port number. FTP protocol is a data link control connection a predetermined number of different well-known port for the control of well-known port number 21 is connected to a predetermined, defined as the data connection is well-known port number 20. FTP protocol uses yes.

Communication persistent connection to maintain control of the connection it established time is usually longer.

The main connection works finished the FTP, followed by the establishment to explain the type of FTP works in two data connections: active mode and passive mode. FTP active mode refers to a client from any FTP server port unprivileged well-known port, i.e. port 21. FTP server receives a command from a further data port connection client ephemeral port, return transactions; passive mode refers to any non-client privileged port two open command is submitted, the FTP server passively open any non-privileged port to send commands to the client , after the client receives a command from the local originating port to transmit data to the FTP server establishing channel connections, in this mode, the command and data connections initiated by the client, the server initiates the client to resolve the problems connected.

Popular terms, if we end the service as a criterion.

Active mode: the server initiate connections to the client from port 20.

Passive mode: the server a port within the specified range of passively waiting for a client initiates a connection.

FTP's goals

1, file sharing, ie the client computer can connect to FTP servers around the world via the Internet and FTP client, file sharing, and shared resources.

2, to achieve information exchange users, namely other computers via the Internet clients to access the FTP server built on top of your computer so that your information material can be spread around the world.

3, efficient data transmission. Are interchangeable between different file types, different systems, different formats computer.

Guess you like

Origin blog.51cto.com/13609234/2423583