1 / 49

FPT

FPT. File Transfer Protocol and RFC 959. Objectives of FTP. Promote the sharing of files To encourage indirect or implicit use of remote computers To shield users from variations in file storage systems To transfer data reliably and efficiently. History.

maeko
Télécharger la présentation

FPT

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FPT File Transfer Protocol and RFC 959

  2. Objectives of FTP • Promote the sharing of files • To encourage indirect or implicit use of remote computers • To shield users from variations in file storage systems • To transfer data reliably and efficiently

  3. History • First proposed file transfer mechanisms in 1971 in RFC 114 and RFC 141 • RFC 354 (1972) defined FTP between hosts on ARPANET • Several RFCs came shortly thereafter • RFC 686 (1975) entitled “Leaving Well Enough Alone” • RFC 959 defines additional commands: • CDUP, SMNT, STOU, RMD, MKD, PWD, SYST

  4. FTP • FTP begins at port 21 • Initially, client and server communicate in plain text • Server will send ‘reply codes’ along with text • client doesn’t need to interpret text • Client will send upper-case commands

  5. How FTP Works Primary Command Thread Server

  6. Enter the Client Primary Command Thread Primary Command Thread Socket (21) Client Server

  7. Server Greeting 220 Welcome! Primary Command Thread Primary Command Thread Socket (21) Client Server

  8. USER Identification USER chastine Primary Command Thread Primary Command Thread Socket (21) Client Server

  9. User Verified 331 User OK… Primary Command Thread Primary Command Thread Socket (21) Client Server

  10. PASSword Sent PASS jeffrox Primary Command Thread Primary Command Thread Socket (21) Client Server

  11. User Now Verified 230 User logged in Primary Command Thread Primary Command Thread Socket (21) Client Server

  12. What we have so far… • Client/server connected by a socket • The user identified

  13. LISTing of Files Primary Command Thread Primary Command Thread Socket (21) Client Server

  14. Set TYPE to ASCII TYPE A Primary Command Thread Primary Command Thread Socket (21) Client Server

  15. Server Responds 200 Type set to A Primary Command Thread Primary Command Thread Socket (21) Client Server

  16. Now the Tricky Part PASV Primary Command Thread Primary Command Thread Socket (21) Client Server • PASV • Requests server to prepare a new socket • Server listens for client on that new port

  17. Server Sets up New Socket Returns IP and port number 227 Entering Passive Mode (168,28,245,183,28,45) Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Client Server

  18. Establish the Data Socket Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Secondary Data Thread Client Socket (2845) Server

  19. Request the LISTing LIST Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Secondary Data Thread Client Socket (2845) Server

  20. Secondary Thread Is Waiting 150 Opening ASCII mode data… Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Secondary Data Thread Client Socket (2845) Server

  21. Establish the Data Socket Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Secondary Data Thread Client Socket (2845) Server <Data is transferred>

  22. Secondary Socket Closes Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Secondary Data Thread Client Socket (2845) Server

  23. Transfer Complete 226 Transfer Complete Primary Command Thread Primary Command Thread Socket (21) Client Server

  24. What We’ve Done Now • Sent a directory listing by: • Sending the request • Establishing a new socket on a new port • Sent/Read the data • Closed the connection • Return back to the original socket • How about for files?

  25. Transfering Files(Client - Receiving) Primary Command Thread Primary Command Thread Socket (21) Client Server

  26. Set TYPE to Image (binary) TYPE I Primary Command Thread Primary Command Thread Socket (21) Client Server

  27. Server Responds 200 Type set to I Primary Command Thread Primary Command Thread Socket (21) Client Server

  28. Tricky Part PASV Primary Command Thread Primary Command Thread Socket (21) Client Server

  29. Server Sets up New Socket Returns IP and port number 227 Entering Passive Mode (168,28,245,183,28,46) Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Client Server

  30. Establish the Data Socket Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Secondary Data Thread Client Socket (2846) Server

  31. RETRieve the File RETR Bob.txt Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Secondary Data Thread Client Socket (2846) Server

  32. Secondary Thread Is Waiting 150 Opening BINARY mode data… Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Secondary Data Thread Client Socket (2846) Server

  33. Establish the Data Socket Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Secondary Data Thread Client Socket (2846) Server <Data is transferred>

  34. Secondary Socket Closes Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Secondary Data Thread Client Socket (2846) Server

  35. Transfer Complete 226 Transfer Complete Primary Command Thread Primary Command Thread Socket (21) Client Server

  36. Question • Why can’t this be done with telnet alone?

  37. Transfering Files(Client - Sending) Primary Command Thread Primary Command Thread Socket (21) Client Server

  38. Set TYPE to Image (binary) TYPE I Primary Command Thread Primary Command Thread Socket (21) Client Server

  39. Server Responds 200 Type set to I Primary Command Thread Primary Command Thread Socket (21) Client Server

  40. Tricky Part PASV Primary Command Thread Primary Command Thread Socket (21) Client Server

  41. Server Sets up New Socket Returns IP and port number 227 Entering Passive Mode (168,28,245,183,28,47) Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2847 Client Server

  42. Establish the Data Socket Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2847 Secondary Data Thread Client Socket (2847) Server

  43. RETRieve the File STOR Bob.txt Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2847 Secondary Data Thread Client Socket (2847) Server

  44. Secondary Thread Is Waiting 150 Opening BINARY mode data… Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2847 Secondary Data Thread Client Socket (2847) Server

  45. Establish the Data Socket Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2847 Secondary Data Thread Client Socket (2847) Server <Data is transferred>

  46. Secondary Socket Closes Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2847 Secondary Data Thread Client Socket (2847) Server

  47. Transfer Complete 226 Transfer Complete Primary Command Thread Primary Command Thread Socket (21) Client Server

  48. Other Commands(no additional socket needed) • PWD – print (or present) working directory • CDUP – Change Dir UP • CWD <dir> - Change Working Directory • RMD <dir> - Remove Directory • MKD <dir> - Make Directory • REIN – reinitialize • QUIT – logout • MODE – Stream*, Block, Compressed *Default

More Related