Note that the data connection may be used to send and receive simultaneously. Note also that the user may initiate a file transfer between two nonlocal mnachines, for example, between two servers. In this case there would be a control connection between the user and both servers but only one data connection, namely, the one between the two servers.
The user is responsible for requesting a close of the control connection, although the server performs the action. if thw control connection is closed while the data connection is still open, then the server may terminate the data transfer. The data connection is usually closed by the server. THe main exception transfer. The data connection is usuallyu clised by the server. Ther main exceoption is when the user DTP closes the data connection to indicate an end of file for a stream transmission. Note that FTP is not designed to detect lost or scrambled bits; the responsibility for error dectrion is left to TCP.
The Telnet protocol works across different systems because it specidies a common starting point for trerminals emulation. FTP works across different systens because it can accommodate severl different file types and structure. FPT commands are used to specify infermation about the file and how it will be commands are used to specify information bout the file and how it will be transmitted . In general, three types of information must be specified. Note that the default specifications must be supported by every FTP implementation.
1. File type. FTP supports ASCII, EBCDICm image (binary), or local. Local specifies that the data is to be transferred in logical bytes, where the size is specified in a separate parameter. ASCII is the default type. If the file is ASCII or EBCDIC, then a vertical format control may also be specified.
2. Data structure. FTP supports file structure ( a continous stram of bytes with no internal structure), recorf structure (used with text files), and page structure (file consist of independent indexed pages). File structure is the default specification.
3. Transmiision mode. FTP supports stram, block, or compressed mode. When transmiision is in stream mode, the user DTP closes the connection to indicate the end of file for data with file structure. If the data has block structure, then a special two-byte sequence indicates and of recorf and end of file. The default is stream mode.
An FTO command consists of three or four bytes of uppercase ASCII characters follwed by a space if parameter follow, or by a Telnet end of option list (EOL) otherwise. FTP commands fall into one of the follwing catagories: access control indentification, data transfer parameters, and FOT service requesnt, Table 2.5 Lists some of the common FTP commands encountered.
Every command must produce at least one FTO reply. The replies are used to synchronize requests and actions and to keep the client informed of the state of the server. A reply consists of a three-digit number (in alphanumeruc representation) fullowed by some text. The numeric code is intended for the user PI; the text, of processed, is intended for the user. For example, the reply issued following a successful connection termination reqest is "221 Goodbye". The first digit indicates whether and to what extent the specidied request has been co,pleted. The secon digit indicates the category of the reply, and the third digit provides
..................... additional information about the particular category. Table 2.6 lists the possible value of the first two digits and their meanings. In this case of the goodbye massage, the first 2 indicates a successsfull completion. The second digit is also 2 to indicate that the reply pertains to a connection request.
Lưu ý rằng kết nối dữ liệu có thể được sử dụng để gửi và nhận được cùng một lúc. Cũng lưu ý rằng người dùng có thể bắt đầu chuyển tập tin giữa hai nonlocal mnachines, ví dụ: giữa hai máy chủ. Trong trường hợp này sẽ có một kết nối điều khiển giữa các người dùng và cả máy chủ, nhưng chỉ có một dữ liệu kết nối, cụ thể là, một trong những giữa hai máy chủ.Người sử dụng chịu trách nhiệm cho các yêu cầu đóng một kết nối điều khiển, mặc dù các máy chủ thực hiện các hành động. Nếu trả điều khiển kết nối đóng cửa trong khi kết nối dữ liệu vẫn còn mở, sau đó các máy chủ có thể chấm dứt việc chuyển giao dữ liệu. Kết nối dữ liệu thường được đóng cửa bởi các máy chủ. Chuyển giao ngoại lệ chính. Kết nối dữ liệu là usuallyu clised bởi các máy chủ. Có exceoption chính là khi người sử dụng DTP đóng kết nối dữ liệu để chỉ ra một kết thúc tệp cho truyền dòng. Lưu ý rằng FTP không được thiết kế để phát hiện bị mất hoặc tranh giành bit; chịu trách nhiệm về lỗi dectrion là trái với TCP.Giao thức Telnet hoạt động trên hệ thống khác nhau vì nó specidies một phổ biến bắt đầu từ điểm cho trerminals thi đua. FTP làm việc trên systens khác nhau bởi vì nó có thể chứa severl các loại tập tin khác nhau và các cấu trúc. FPT lệnh được sử dụng để xác định infermation về các tập tin và làm thế nào nó sẽ là lệnh được sử dụng để xác định thông tin bout file và làm thế nào nó sẽ được truyền đi. Nói chung, ba loại thông tin phải được xác định. Lưu ý rằng mặc định thông số kỹ thuật phải được hỗ trợ bởi mỗi thực hiện FTP.1. loại tập tin. Hỗ trợ FTP ASCII, hình ảnh EBCDICm (nhị phân), hoặc địa phương. Địa phương chỉ định rằng dữ liệu là để được chuyển giao trong logic byte, mà kích thước được chỉ định trong tham số riêng biệt. ASCII là loại mặc định. Nếu tập tin ASCII hoặc EBCDIC, sau đó kiểm soát định dạng thẳng đứng có thể cũng được chỉ định.2. dữ liệu cấu trúc. FTP hỗ trợ cấu trúc file (một liên tục stram byte không có cấu trúc nội bộ), cơ cấu recorf (được sử dụng với các tập tin văn bản), và trang cấu trúc (tập tin bao gồm các trang được lập chỉ mục độc lập). Tập tin cấu trúc là đặc điểm kỹ thuật mặc định.3. Transmiision chế độ. FTP hỗ trợ stram, khối hoặc chế độ nén. Khi transmiision ở chế độ dòng, người sử dụng DTP đóng kết nối để chỉ kết thúc tệp dữ liệu với cấu trúc tập tin. Nếu dữ liệu có cấu trúc khối, sau đó chỉ ra một chuỗi đặc biệt hai byte recorf và kết thúc tệp. Mặc định là chế độ dòng.Một lệnh FTO bao gồm ba hoặc bốn byte của chữ ký tự ASCII follwed bởi một không gian nếu làm theo tham số, hoặc một Telnet cuối danh sách lựa chọn (EOL) nếu không. FTP lệnh rơi vào một trong các loại follwing: kiểm soát truy cập ITC, các thông số chuyển dữ liệu và FOT dịch vụ requesnt, bảng 2.5 liệt kê một số lệnh FTP thông thường gặp.Mọi lệnh phải sản xuất ít nhất một FTO trả lời. Các bài trả lời được sử dụng để đồng bộ hóa các yêu cầu và hành động và giữ cho khách hàng thông báo trạng thái của máy chủ. Một lời bao gồm một fullowed ba chữ số (trong alphanumeruc đại diện) bởi một số văn bản. Mã số là dành cho người sử dụng PI; Các văn bản, trong xử lý, được thiết kế cho người dùng. Ví dụ, lời phát hành sau một kết nối thành công chấm dứt reqest là "221 Goodbye". Chữ số đầu tiên cho thấy cho dù và đến mức độ nào yêu cầu specidied đã là co, pleted. Secon chữ chỉ các loại trả lời, và chữ thứ 3 cung cấp... thêm thông tin về danh mục cụ thể. Bảng 2.6 liệt kê các giá trị có thể lần đầu tiên hai chữ số và ý nghĩa của chúng. Trong trường hợp này massage tạm biệt, 2 đầu tiên cho thấy một successsfull hoàn thành. Chữ số thứ hai là 2 để chỉ trả lời liên quan đến yêu cầu kết nối.
đang được dịch, vui lòng đợi..
