Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Networks and Internets 《计算机网络与因特网》课件 林坤辉 2004-02-6.

Similar presentations


Presentation on theme: "Computer Networks and Internets 《计算机网络与因特网》课件 林坤辉 2004-02-6."— Presentation transcript:

1 Computer Networks and Internets 《计算机网络与因特网》课件 林坤辉 2004-02-6

2 PART IV Network Applications Chapter 31 File Transfer And Remote File Access 文件传输与远程文件访问

3 FTP

4 Control Connection (1) The server issues a passive open on the well-known port and waits for a client.

5 Control Connection (2) The client uses an ephemeral port and issues an active open.

6 Data Connection (1) The client issues a passive open using an ephemeral port.

7 Data Connection (2) The client sends this port number to the server using the PORT command.

8 Data Connection (3) The server receives the port number and issues an active open using the well- known port 20 and the receive ephemeral port number. Active open by server

9 Communication is achieved through commands and responses. FTP uses the NVT ASCII character set Communication over Control Connection

10 The client must define the type of file to be transferred,the structure of the data,and the transmission mode. Communication over Data Connection Heterogeneity problem

11 ASCII file: this is the default format for transferring text files. Each character is encoded using NVT ASCII. this is the default format for transferring text files. Each character is encoded using NVT ASCII. The sender transforms the file form its own representation into NVT ASCII characters and the receiver transforms the NVT ASCII characters to its own representation. The sender transforms the file form its own representation into NVT ASCII characters and the receiver transforms the NVT ASCII characters to its own representation. File Type (1)

12 EBCDIC file: EBCDIC: Extended Binary-Coded Decimal Interchange Code 扩充的二 — 十进制 交换码. EBCDIC: Extended Binary-Coded Decimal Interchange Code 扩充的二 — 十进制 交换码. if one or both ends of the connection use EBCDIC encoding,the file can be transferred using EBCDIC encoding. if one or both ends of the connection use EBCDIC encoding,the file can be transferred using EBCDIC encoding. File Type (2)

13 Image file: this is the default format for transferring binary files. this is the default format for transferring binary files. the file is sent as continuous streams of bits without any interpretation or encoding. the file is sent as continuous streams of bits without any interpretation or encoding. This is mostly used to transfer binary files such as compiled programs. This is mostly used to transfer binary files such as compiled programs. File Type (3)

14 File structure(default): it is a continuous stream of bytes. Record structure: the file is divided into records.this can be used only by with text files. Page structure: the file is divided into pages, with each page having a page number and a page header.the pages can be stored or accessed randomly or sequentially. Data Structure

15 Stream mode: this is the default mode. Data are delivered from FTP to TCP as a continuous stream of bytes. Block mode: data can be delivered from FTP to TCP in blocks.each block is preceded by a 3-byte header. Compressed mode: if the file is big,the data can be compressed. the compression method used is normally run-length encoding( 游程长度编码 ). In a binary file,null characters are usually compressed. Transmission mode

16 FTP uses the control connection to establish a communication between the client control process and the server control process. Command processing

17 Access commands These commands let the user access the remote system.

18 these commands let the user access the file system on the remote computer File management commands(1)

19 File management commands(2)

20 these commands let the user define the data structure,file type,and transmission mode. Data formatting commands

21 these commands let the user define the port number for the data connection on the client site. Port defining commands

22 these commands let the user transfer files. File transfer commands

23 Responses(1)

24 上图的前一部分 上图的前一部分 Responses(2)

25 Responses(3)

26 File transfer occurs over the data connection under the control of the commands set over the control connection. File Transfer

27 Example 1

28 例 1 的部分( 1 )

29 例 1 的部分( 2 )

30 Example 2

31 例 2 的部分( 1 )

32 例 2 的部分( 2 )

33 TFTP( 简单文件传输协议 ) : TFTP uses the services of UDP on the well-known port 69. TFTP uses the services of UDP on the well-known port 69. Trivial File Transfer Protocol TFTP 是一种简化的 TCP/IP 文件传输协议。 TFTP 只限于简单文件传输操作,它不提供 权限控制,也不支持客户与服务器之间复 杂的交互过程,没有庞大的命令集,没有 列目录的功能,不能鉴别用户身份。因此 TFTP 软件比 FTP 软件小的多。

34 NFS() : NFS( 网络文件系统 ) : NFS allows an application to open a remote file, move to a specified position in the file, and read or write data starting at that position. NFS allows an application to open a remote file, move to a specified position in the file, and read or write data starting at that position. Network File System

35 NFS 也是基于 RPC 的客户 / 服务器模型实现, 在进行远地文件访问的过程中, NFS 将用到 远程过程调用 RPC(Remote Procedure Call) NFS 允许应用进程打开一个远程文件,并能 在该文件的某一特定的位置上开始读写数据。 这样使用 NFS 可以只复制一个大文件中一小 片段,而不必复制整个大文件。

36 作业 1 、为什么客户发出的控制连接是主动打开, 但发出的数据连接是被动打开。


Download ppt "Computer Networks and Internets 《计算机网络与因特网》课件 林坤辉 2004-02-6."

Similar presentations


Ads by Google