当前位置:网站首页>文件传输协议--FTP
文件传输协议--FTP
2022-06-28 00:26:00 【竹某】
一.FTP模型

FTP client在客户端提供了一个user interface,这是用户使用FTP系统进行文件操作的接口。在user interface下,用户可以使用user command进行文件操作。user command和Linux command非常像。在后续会有介绍。
Client PI全名为Client Protocol Interpreter,作用是进行user command和FTP command的转化(两者的区别可以看作是源代码和机械码、ASCII形式的域名和二进制形式的IP地址的区别)(用户的user command会交给client PI,转化为FTP command;而client PI会将得到的FTP command转化为用户看得懂的形式交给user interface),并且会将FTP command传输给Server PI和Client DTP。 一个Client只有一个PI。
Server PI的作用是接受Client PI的FTP command,控制Server DTP。 一个Server只有一个PI。
DTP全称为Data Transfer Process。是为了数据传输而建立的进程,Client和Server端各需要建立一个,用于一个文件的数据传输。一旦传输完成就会被PI给释放掉。所以可以看出DTP在Server和Client是对应出现的,且不只一对。

FTP模型的特点是,其建立了两种连接通道。Control Connection每一对client PI和server PI只能建立一个,用于FTP command的传输。因为FTP command需要FTP的客户端和服务器端配合完成,所以建立Control Connection是有意义的。Control connection由于使用ASCII编码,所以符合Telnet Protocol。 Data Connection是每一对client DTP和server DTP之间的连接通道,用于两者间的数据传输。server建立的data connection称为active,client建立的称之为passive。
FTP server是服务器上的一个进程,其使用21号port监听客户端的control connection连接请求。control connection建立后,server接受client的commands,返回reply。
FTP client是直接和user打交道的,其负责打开control connection。注意control connection是由双方共同建立,但是只能由FTP client打开。但是data connection双方均可以打开,视实际情况而定。 FTP client的编码方式(传输的命令)和telnet一样,使用8比特的ASCII。
二.User command&FTP command
需要注意的是control connection中传输的是FTP command(ASCII的形式),而用户具体使用的是User command。两者需要client PI来进行转化。


三.示例:downloading in Active Mode

这是FTP文件传输的一个示例。之所以称之为active mode是因为data connection是由server端open(申请建立)的。
从上面我们可以看出control connection和data connection的区别
1.control connection标识一对server和client,用于两者PI之间FTP命令的交换;而data connection标识了一次文件的数据传输过程,用于两者DTP间的数据传输。
2.control connection只能由client端open。建立之后,需要客户端的quit命令才会释放。而data connection是动态建立的,仅用于一次文件传输过程,传输完成后就会被释放。
3.control connection使用21号端口;但是data connection却不一定,其使用的端口需要server和client通过control connection进行协商。
边栏推荐
- Based on am335x development board arm cortex-a8 -- acontis EtherCAT master station development case
- Take n multiple table names of a database as the values of a column in another table (the range can be a table in another database)
- [Yocto RM]9 - QA Error and Warning Messages
- 基于AM335X开发板 ARM Cortex-A8——Acontis EtherCAT主站开发案例
- Cesium 点击获取经纬度(二维坐标)
- The practice of dual process guard and keeping alive in IM instant messaging development
- Appium自动化测试基础— 补充:App的包名(appPackage)和启动名(appActivity)
- [Yocto RM]8 - OpenEmbedded Kickstart (.wks) Reference
- SQL 注入绕过(五)
- Numpy----np.meshgrid()
猜你喜欢

Machine learning notes - time series as features

Google Earth engine (GEE) -- an error caused by the imagecollection (error) traversing the image collection

How to handle computer security certificate errors
![[embedded foundation] memory (cache, ram, ROM, flash)](/img/bd/d952ebd4033a993dd16cd792bb3e1e.png)
[embedded foundation] memory (cache, ram, ROM, flash)

Numpy----np. meshgrid()

Appium自动化测试基础 — ADB常用命令(一)

Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)

基于AM335X开发板 ARM Cortex-A8——Acontis EtherCAT主站开发案例

Figure out the difference between MIT, BSD and Apache open source protocols

Intranet penetration with FRP
随机推荐
Solve the problem that the page cannot scroll when ionic4 uses the hammerjs gesture press event
New choice for database Amazon Aurora
SQL 注入绕过(二)
How to study efficiently
JS 数组随机取值(随机数组取值)
STM32的通用定时器与中断
Appium自动化测试基础 — ADB常用命令(一)
Original | 2025 to achieve the "five ones" goal! The four products of Jiefang power are officially released
Jenkins - email notification plug-in
To understand what is synchronous, asynchronous, serial, parallel, concurrent, process, thread, and coroutine
geojson 格式說明(格式詳解)
Self supervised learning and drug discovery
嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)
Jenkins - data sharing and transfer between copy artifact plug-in builds
深入解析kubernetes controller-runtime
Jenkins - access the Jenkins user-defined parameter variable, and handle the variable value containing spaces
OS module and os Learning of path module
Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)
外盘期货哪里可以开户?哪个平台出入金比较安全?
Embedded must learn! Detailed explanation of hardware resource interface - based on arm am335x development board (Part 2)