Presentation is loading. Please wait.

Presentation is loading. Please wait.

Department of Computer Science Southern Illinois University Edwardsville Spring, 2008 Dr. Hiroshi Fujinoki FTP Protocol Programming.

Similar presentations


Presentation on theme: "Department of Computer Science Southern Illinois University Edwardsville Spring, 2008 Dr. Hiroshi Fujinoki FTP Protocol Programming."— Presentation transcript:

1 Department of Computer Science Southern Illinois University Edwardsville Spring, 2008 Dr. Hiroshi Fujinoki E-mail: hfujino@siue.edu FTP Protocol Programming (Part II) FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

2 FTP Commands Commands Semantics USER Transmit a login name of a user to the FTP server Transmit the password of a user to the FTP server PASS RETR Download a file from the FTP server STOR Upload a file to the FTP server TYPE Set ASCII/Binary transmission mode SYST Display FTP server information LISTList (display) the directory contents PWD List the current directory path DELE Delete a remote file QUITClose the current FTP session (Most essential FTP commands) These are the FTP Protocol-Level Commands FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

3 FTP Server (FTP Daemon) FTP Client FTP Architecture PI = Protocol Interpreter DTP = Data Transfer Process Client PI GUI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files Protocol-Level Commands FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

4 FTP Application-Level Commands Commands Semantics USER Transmit a login name of a user to the FTP server Transmit the password of a user to the FTP server PASS RETR Download a file from the FTP server STOR Upload a file to the FTP server TYPE Set ASCII/Binary transmission mode SYST Display FTP server information LISTList (display) the directory contents PWD List the current directory path DELE Delete a remote file QUITClose the current FTP session (FTP application commands you need to implement) FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

5 FTP Server (FTP Daemon) FTP Client FTP Architecture PI = Protocol Interpreter DTP = Data Transfer Process Client PI GUI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files Application-Level Commands FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

6 Application-Level Commands Protocol-Level Commands 1. USER 2. PASS 3. SYST * 2. LIST 1. PWD 1. PORT open ls (or dir) pwd cd 1. CWD * indicates an optional FTP command Application-level and Protocol-level commands correspondence FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

7 Application-Level Commands Protocol-Level Commands 4. RETR 3. STOR 1. TYPE * 5. MDTM * 1. TYPE * get put 2. PORT 2. SIZE 3. PORT * indicates an optional FTP command Application-level and Protocol-level commands correspondence (continued) FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

8 Application-Level Commands Protocol-Level Commands 1. DELE 2. QUIT delete exit Application-level and Protocol-level commands correspondence (continued) FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

9 Starting the FTP client program C:\My_FTP ENTER C:\My_FTP ENTER FTP> Your FTP program should be started at the DOS command prompt Then, the command prompt message should be changed to “FTP>” FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

10 “open” command Command Format: open FTP Server IP = IP address of the FTP server Data Connection Port# = The port number used for file transmissions (Standard port # = 20, but we can change it) FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

11 “open” command (continued) open  Prompt and transmit the user login name (USER command)  Prompt and transmit user password (PASS command)  Acquire the FTP server information (SYST command) FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

12 “open” command (continued) SYST Command: FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

13 “ls” command Command Format: ls (no argument) ls (no argument)  Transfer the IP address of this FTP client and the port# to be used for data transmission (PORT command)  Request the FTP server to send the directory list of the current working directory (LIST command) FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

14 “ls” command (continued) PORT Command: FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

15 FTP Server (FTP Daemon) FTP Client Client PI UI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files “ls” command (continued) “ls”  PORT  LIST + A list of directory entries FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

16 “pwd” command Command Format: pwd (no argument) pwd (no argument)  Request the FTP server to return the current working directory (PWD command) FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

17 FTP Server (FTP Daemon) FTP Client Client PI UI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files “pwd” command (continued) “pwd”  PWD Pwd info. FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

18 “cd” command Command Format: cd cd  Request the FTP server to change the current working directory (CWD command) FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

19 FTP Server (FTP Daemon) FTP Client Client PI UI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files “cd” command (continued) “cd”  “CWD” FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

20 “get” command Command Format: get get  Specify transmission file type = binary (TYPE command) FTP.ppt/001  Request the FTP server to send the file size (in bytes) (SIZE command)  Transfer the IP address of this FTP client and the port# to be used for data transmission (PORT command) (continue) CS 447 Network and Data Communication, Project Phase 2

21 “get” command (continued) FTP.ppt/001  Acquire information about the transferred file (MDTM command)*  Initiate file transmission (receive) (RETR command) CS 447 Network and Data Communication, Project Phase 2

22 “get” command (continued) FTP.ppt/001 TYPE Command SIZE SIZE Command TYPE I (for a binary file and a text file) TYPE II (for text file transmission with automatic format convert) If success, the FTP server returns the size of the file in bytes. CS 447 Network and Data Communication, Project Phase 2

23 FTP Server (FTP Daemon) FTP Client Client PI UI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files “TYPE” FTP.ppt/001 Confirmation Message “get” command (continued) TYPE Command Confirmation Message: “200 Type set to I” CS 447 Network and Data Communication, Project Phase 2

24 FTP Server (FTP Daemon) FTP Client Client PI UI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files “SIZE” FTP.ppt/001 File Size “get” command (continued) SIZE Command File Size:“213 1047851” File size in bytes CS 447 Network and Data Communication, Project Phase 2

25 FTP Server (FTP Daemon) FTP Client Client PI UI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files “RETR” FTP.ppt/001 “get” command (continued) RETR Command Confirmation Message Confirmation Message: 150 Opening BINARY mode data... Requested File CS 447 Network and Data Communication, Project Phase 2

26 “get” command (continued) FTP.ppt/001 MDTM Command The last updated date MDTM *This command is optional (does not have to be executed) CS 447 Network and Data Communication, Project Phase 2

27 FTP Server (FTP Daemon) FTP Client Client PI UI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files “MDTM” FTP.ppt/001 File Updated Date “get” command (continued) MDTM Command File Size:“213 20001117031013” Date and time for last update CS 447 Network and Data Communication, Project Phase 2

28 CS 547/CS490 Advanced Network Programming “put” command Command Format: put put  Specify transmission file type = binary (TYPE command) FTP.ppt/001  Transfer the IP address of this FTP client and the port# to be used for data transmission (PORT command)  Initiate file transmission (send) (STOR command) CS 447 Network and Data Communication, Project Phase 2

29 FTP Server (FTP Daemon) FTP Client Client PI UI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files “STOR” FTP.ppt/001 “put” command (continued) STOR Command Confirmation Message Confirmation Message: 150 Opening BINARY mode data... Requested File CS 447 Network and Data Communication, Project Phase 2

30 “bye” command Command Format: bye (no argument) bye (no argument)  Declare the end of an FTP session and the client is now leaving the server (QUIT command) FTP.ppt/001 CS 447 Network and Data Communication, Project Phase 2

31 FTP Server (FTP Daemon) FTP Client Client PI UI Client DTP FTP Client Disk Server PI Server DTP Disk FTP Server Commands Files “QUIT” FTP.ppt/001 “bye” command (continued) QUIT Command Confirmation Message CS 447 Network and Data Communication, Project Phase 2

32 Advanced FTP file transmissions FTP.ppt/001 PORT command can specify both IP address and port# It is possible for the third FTP client to trigger data transmissions between two remote FTP servers CS 447 Network and Data Communication, Project Phase 2

33 FTP Server 1 Server PI Server DTP FTP Server 2 Disk Server PI Server DTP Disk FTP Server 1 Files FTP.ppt/001 FTP Client FTP Server 2 STOR RETR    CS 447 Network and Data Communication, Project Phase 2


Download ppt "Department of Computer Science Southern Illinois University Edwardsville Spring, 2008 Dr. Hiroshi Fujinoki FTP Protocol Programming."

Similar presentations


Ads by Google