当前位置:网站首页>文件傳輸協議--FTP
文件傳輸協議--FTP
2022-06-28 02: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進行協商。
边栏推荐
- 对比学习中的4种经典训练模式
- 嵌入式必学,硬件资源接口详解——基于ARM AM335X开发板 (上)
- Review of drug discovery-03-molecular design and optimization
- Shardingsphere-proxy-5.0.0 establish MySQL read / write separation connection (6)
- yarn下载报错There appears to be trouble with your network connection. Retrying.
- 【sylixos】i2c设备驱动创建和使用
- Numpy----np. Tile() function parsing
- pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...
- [Yocto RM]9 - QA Error and Warning Messages
- Cesium Click to draw polygons (dynamically draw polygons)
猜你喜欢

利用redis bitmap实现人员在线情况监控

MySQL interview question set

Cesium obtains the latitude and longitude range of the screen

The interviewer asked: can you simulate the new operator of JS

Appium automation test foundation ADB common commands (I)

How to handle computer security certificate errors

frp实现内网穿透

Jenkins - Copy Artifact 插件 Build 之间数据共享传递

Jenkins - Pipeline syntax

Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)
随机推荐
AAVE launches lens protocol, a Web3 social media platform
Jenkins - Pipeline 语法
Ti am3352/54/59 industrial core board hardware specification
Jenkins - Pipeline concept and creation method
一张图弄懂 MIT,BSD,Apache几种开源协议之间的区别
Cesium anti aliasing (lines, borders, etc.)
Numpy----np. reshape()
Original | 2025 to achieve the "five ones" goal! The four products of Jiefang power are officially released
引用层reboot后的大体流程
Differences between cesium polygon extrudedheight and height
Shardingsphere-proxy-5.0.0 establish MySQL read / write separation connection (6)
嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)
JS 数组随机取值(随机数组取值)
Appium automation test foundation - Supplement: app package name and appactivity
How to use metauniverse technology to create a better real world
Capacitor
JS random number (random number decimal)
Cesium 获取屏幕所在经纬度范围
PV operation primitive
205. 同构字符串