01-FTP

01-FTP

FTP features

FTP session (stateful).
FTP is comparatively simple.
FTP is better suited (faster,more efficient) for large files.
FTP has a control and a data connection and communicates TCP port numbers for data connection in control connection (so-called ‚non-well-behaving‘ protocol).

FTP uses a TCP control and data connection.

The TCP control connection is used for opening / closing an FTP session and for transferring commands from client to server.

The data connection is used for transferring individual files between client and server.
Every file transfer uses a separate data connection.

active mode procedure

1. Open control connection
The Client opens a control connection to the server (TCP).
This control connection (<font color=901ff size=5 face="΢ÈíÑźÚ"> server port 21</font>, the client uses an <font color=901ff size=5 face="΢ÈíÑźÚ"> ephemeral port</font>) is used for FTP commands (C>S) and FTP replies (S<C).

2. File transfer command
The client initiates a file transfer (C>S: STOR, S<C: RETR).

3. Data connection for transfer
A new data connection (TCP, usually <font color=901ff size=5 face="΢ÈíÑźÚ"> server port 20</font>, the client uses an <font color=901ff size=5 face="΢ÈíÑźÚ"> ephemeral port</font>) is created for the transfer of the file. In <font color=ff0199 size=5 face="΢ÈíÑźÚ">active mode</font>  (see below), this connection is opened by the server (for RETR and STOR operations).

4. End of file transfer
The sender (server for RETR operation, client for STOR operation) closes the data TCP
connection when the file is completely transferred.

5. Close control connection
At the end of the FTP session, the client closes the control connection.

主動模式中,數據傳輸階段client 端口由client 決定,server 端口爲 20


passive mode procedure

  1. client server TCP shakehand
  2. client send PASV command
  3. server determine ephemeral port and make connection with client(ephemeral port)
  4. transfer data
  5. end of file transfer
  6. close control connection

被動模式中,數據傳輸階段client 端口隨機,server 端口隨機


常見FTP server client

常見FTP服務器

IIS、Serv-U Filezilla    //windows
wu-ftpd、Proftpd  //proftpd 
vsftpd(Very Secure FTP Daemon)

常見FTP客戶端

ftp命令  ie chrome  
CuteFTP、FlashFXP、LeapFTP、Filezilla
gftp、kuftp
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章