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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值