over view rfc 959 file transfer protocol (ftp). c ontents the ftp model data transfer functions ...

17
OVERVIEW RFC 959 FILE TRANSFER PROTOCOL (FTP)

Upload: brooke-morgan

Post on 23-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

OVERVIEW RFC 959FILE TRANSFER PROTOCOL (FTP)

Page 2: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

CONTENTS

The Ftp Model Data transfer functions File transfer functions Declarative specifications State diagrams Typical Ftp scenario

Page 3: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

THE FTP MODEL

Page 4: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

THE FTP MODEL

Page 5: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

DATA TRANSFER FUNCTIONS

1. Data representation and storage2. Establishing data connections3. Data connection management4. Transmission modes5. Error recovery and restart

Page 6: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

DATA TRANSFER FUNCTIONS

1. Data representation and storage Data types:

ASCII type: This is the default type and must be accepted by all FTP implementations. It is intended primarily for the transfer of text files, except when both hosts would find the EBCDIC type more convenient.

EBCDIC type: This type is intended for efficient transfer between hosts which use EBCDIC for their internal character representation.

Image type (Binary): Image type is intended for the efficient storage and retrieval of files and for the transfer of binary data. It is recommended that this type be accepted by all FTP implementations.

Local type: Allows two computers with identical setups to send data in a proprietary format without the need to convert it to ASCII

Page 7: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

DATA TRANSFER FUNCTIONS

1. Data representation and storage Data structures:

File structure: is the default to be assumed if the STRU command has not been used. In file-structure there is no internal structure and the file is considered to be a continuous sequence of data bytes.

Record structure: must be accepted for "text" files (i.e., files with TYPE ASCII or EBCDIC) by all FTP implementations.

Page structure: To transmit files that are discontinuous, FTP defines a page structure.

Page 8: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

DATA TRANSFER FUNCTIONS

2. Establishing data connections• The server has completed sending data in a transfer

mode that requires a close to indicate EOF.• The server receives an ABORT command from the

user. • The port specification is changed by a command from

the user.• The control connection is closed legally or otherwise.• An irrecoverable error condition occurs

Page 9: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

DATA TRANSFER FUNCTIONS

3. Data connection managementDefault Data Connection Ports: All FTP implementations must support use of the default data connection ports, and only the User-PI may initiate the use of non-default ports.

Negotiating Non-Default Data Ports: The User-PI may specify a non-default user side data port with the

PORT command. The User-PI may request the server side to identify a non-default server side data port

with the PASV command. Since a connection is defined by the pair of addresses, either of these actions is

enough to get a different data connection, still it is permitted to do both commands to use new ports on both ends of the data connection.

Page 10: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

DATA TRANSFER FUNCTIONS

4. Transmission modes Stream mode: The data is transmitted as a stream of

bytes. There is no restriction on the representation type used; record structures are allowed. If the structure is a file structure, the EOF is indicated by the sending host closing the data connection and all bytes are data bytes.

Page 11: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

DATA TRANSFER FUNCTIONS

4. Transmission modes Block mode: The file is transmitted as a series of

data blocks preceded by one or more header bytes. The header bytes contain a count field, and descriptor code. The count field indicates the total length of the data block in bytes, thus marking the beginning of the next data block (there are no filler bits).

The descriptor codes are indicated by bit flags in the descriptor byte. Four codes have been assigned, where each code number is the decimal value of the corresponding bit in the byte (Code: 128, 64, 32, 16)

Page 12: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

DATA TRANSFER FUNCTIONS

4. Transmission modes Compressed mode:

Page 13: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

FILE TRANSFER FUNCTIONS

1. FTP commands2. FTP replies

Page 14: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

FILE TRANSFER FUNCTIONS

1. FTP commands ABOR - abort a file transfer CWD - change working directory DELE - delete a remote file LIST - list remote files MDTM - return the modification time of a file MKD - make a remote directory NLST - name list of remote directory PASS - send password PASV - enter passive mode PORT - open a data port PWD - print working directory QUIT - terminate the connection RETR - retrieve a remote file RMD - remove a remote directory RNFR - rename from RNTO - rename to

Page 15: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

FILE TRANSFER FUNCTIONS

1. FTP commands SITE - site-specific commands SIZE - return the size of a file STOR - store a file on the remote host TYPE - set transfer type USER - send username ACCT* - send account information APPE - append to a remote file CDUP - CWD to the parent of the current directory HELP - return help on using the server MODE - set transfer mode NOOP - do nothing REIN* - reinitialize the connection STAT - return server status STOU - store a file uniquely STRU - set file transfer structure SYST - return system type

Page 16: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications
Page 17: OVER VIEW RFC 959 FILE TRANSFER PROTOCOL (FTP). C ONTENTS  The Ftp Model  Data transfer functions  File transfer functions  Declarative specifications

STATE DIAGRAMS

Diagram models commands:

Note: Success (S), failure (F), error (E), begin (B) and wait (W)