Full knowledge of FTP from TCP/IP model

Source: Internet
Author: User

1. FTP protocol Overview

FTP is the abbreviation for File Transfer Protocol (Transfer Protocol). FTP is a specific application of TCP/IP, it works on the seventh layer of the OSI model, on the fourth layer of the TCP model, the application layer, using TCP transmission instead of UDP,FTP connection is reliable, and it is connection-oriented, which provides a reliable guarantee for data transmission.

The FTP operating mode is similar to the client/server model. Unlike most other TCP applications, FTP uses two TCP connections between the client and the server--control the connection and the data connection, the control connection exists in the whole process of the client interacting with the server, and the data connection is created only when there is a file or directory transmission, and is closed after use. The control connection is used to send instructions to the server and wait for the server to respond, and the data connection is used to establish the data transfer channel.

Two connection modes of 2.FTP ―――port mode and passive mode

FTP uses a different TCP port number, depending on whether you are using port mode or passive mode.

2.1 FTP Port Mode

The FTP steps for Port mode are as follows:

1, the client sends a TCP SYN (TCP synchronization) packet to the server segment well-known FTP control port 21, the client uses the temporary port as its source port;

2, the server sends the SYN ACK (synchronous confirmation) package to the client, the source port is 21, the destination port is the temporary port which uses on the client end;

3, the client sends an ACK (confirm) package, the client uses this connection to send the FTP command, the server side uses this connection to send the FTP reply;

4. When the user requests a list request or initiates a request to send or accept a file, the client software uses the Port command, which contains a temporary port, and the client expects the server to use this temporary port when opening a data connection; The port command also contains an IP address, this IP address is usually the client's own IP address, and FTP also supports the third party (third-party) mode, the third party mode is the client told the server side to open the connection with another host;



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.