当前位置:网站首页>文件传输协议--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进行协商。
边栏推荐
- Jenkins - Pipeline 语法
- Numpy----np. reshape()
- [Niuke discussion area] Chapter 4: redis
- Cesium Color 颜色(赋值)随机颜色
- Fundamentals of scala (3): operators and process control
- frp实现内网穿透
- 要搞清楚什么是同步,异步,串行,并行,并发,进程,线程,协程
- Jenkins - data sharing and transfer between copy artifact plug-in builds
- 利用redis bitmap实现人员在线情况监控
- Embedded must learn! Detailed explanation of hardware resource interface - based on arm am335x development board (Part 2)
猜你喜欢

Class initialization and callback usage

Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)

Jenkins - data sharing and transfer between copy artifact plug-in builds

Cesium 多边形增加文字标签(polygon 加 label)多边形中心点偏移问题解决

Embedded must learn! Detailed explanation of hardware resource interface - based on arm am335x development board (Part 2)

系统管理员设置了系统策略,禁止进行此安装。解决方案

Evaluation - rank sum ratio comprehensive evaluation

嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)

TI AM3352/54/59 工业核心板硬件说明书

SQL 注入绕过(二)
随机推荐
Voice network VQA: make the user's subjective experience of unknown video quality in real-time interaction known
Numpy----np.tile()函数解析
学习 pickle
I/o limit process and CPU limit process
Evaluation - grey correlation analysis
[Yocto RM]3 - Yocto Project Releases and the Stable Release Process
Differences between cesium polygon extrudedheight and height
Review of drug discovery-03-molecular design and optimization
外盘期货哪里可以开户?哪个平台出入金比较安全?
[sylixos] I2C device driver creation and use
Using redis bitmap to realize personnel online monitoring
ionic4实现半星评分
[Yocto RM]1 - System Requirements
STM32的通用定时器与中断
声网 VQA:将实时互动中未知的视频画质用户主观体验变可知
[Yocto RM]8 - OpenEmbedded Kickstart (.wks) Reference
frp实现内网穿透
Numpy----np. reshape()
【ELT.ZIP】OpenHarmony啃论文俱乐部—数据密集型应用内存压缩
Deep parsing of kubernetes controller runtime