FTPFTP: the file transfer protocol transfer file to/from remote host client/server model client: side that initiates transfer (either to/from remote) server: remote host ftp: RFC 959 ftp server: port 21file transferFTPserverFTPuserinterfaceFTPclientlocal filesystemremote filesystemuser at hostFTP: separate control, data connections FTP client contacts FTP server at port 21, specifying TCP as transport protocol Client obtains authorization over control connection Client browses remote directory by sending commands over control connection. When server receives a command for a file transfer, the server opens a TCP data connection to client After transferring one file, server closes connection.FTPclientFTPserverTCP control connectionport 21TCP data connectionport 20 Server opens a second TCP data connection to transfer another file. Control connection: “out of band” FTP server maintains “state”: current directory, earlier authenticationFTP commands, responsesSample commands: sent as ASCII text over control channel USER username PASS password LIST return list of file in current directory RETR filenameretrieves (gets) file STOR filename stores (puts) file onto remote hostSample return codes status code and phrase (as in HTTP) 331 Username OK, password required 125 data connection already open; transfer starting 425 Can’t open data connection 452 Error writing fileFTP uses the services of TCP. FTP uses the services of TCP. It needs two TCP connections. It needs two TCP connections. The wellThe well--known port 21 is used known port 21 is used for the control connection for the control connection and the welland the well--known known port 20 for the data connection.port 20 for the data connection.FTPOpening the control connectionCreating the data connectionCommand processingFile
View Full Document