DOC PREVIEW
Berkeley ELENG 122 - FTP - File Transfer Protocol

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

11FTP: File Transfer ProtocolEE 122: Intro to Communication NetworksFall 2007 (WF 4-5:30 in Cory 277)Vern PaxsonTAs: Lisa Fowler, Daniel Killebrew & Jorge Ortizhttp://inst.eecs.berkeley.edu/~ee122/Materials with thanks to Jennifer Rexford, Ion Stoica,and colleagues at Princeton and UC Berkeley2File Transfer Protocol (FTP)• Allows a user to copy files to/from remote hosts• Usage:– Client connects to the FTP server– User provides a login id and password to become authenticated– User can explore the directories– User can download files from and upload files to the server• A predecessor of the Web (RFC 959 in 1985)• No URL, hypertext, and helper applications to assist user– Requirements for the user:o Know the name of the server machineo Have an account on the machineo Can find the directory where the files are storedo Know whether the file is text or binaryo Know what tool to run to render and edit the file23How Do You Transfer Files Today?• HTTP - the usual Web transfer mechanism (http://)• FTP – You may not have realized that you use it– ftp:// links in web pages (e.g.: www.kernel.org)• sftp – E.g.: to upload your project files to EECS inst. machines• BitTorrent and other file-sharing software• scp• Any others?4Why Study FTP?• Helps cement familiarity with text/status-code based protocols (similar to SMTP)• Illustrates use of multiple concurrent connections– One for control (commands & replies)– Another connection for data (depending on the command)• Illustrates reversal of roles– For data connection, FTP user’s process plays the server role, FTP server plays the client role • We’ll later use FTP as an example when looking at issues with Network Address Translation (NAT)35Example Commands• Authentication– USER: specify the user name for login– PASS: specify the user’s password• Exploring the files– LIST: list the files for the given file specification– CWD: change to the given directory• Downloading and uploading files– TYPE: set type to ASCII (A) or binary image (I)– RETR: retrieve the given file– STOR: upload the given file• Closing the connection– QUIT: close the FTP connection6Server Response Codes•1xx: positive preliminary reply– The action is being started, but expect another reply before sending the next command. •2xx: positive completion reply– The action succeeded and a new command can be sent. •3xx: positive intermediate reply– The command was accepted but another command is now required. •4xx: transient negative completion reply– The command failed and should be retried later. •5xx: permanent negative completion reply– The command failed and should not be retried.47FTP Data Transfer• Use separate data connection to:–Send lists of files (LIST)–Retrieve a file (RETR)–Upload a file (STOR)controldata8Creating the Data Connection• Client acts like a server– Creates a socketo Assigned an ephemeral port number by the kernel– Listens on socket– Waits to hear from FTP servercontrolsocket59Creating Data Connection (cont.)• But, the server doesn’t know the port number• After listening, client tells it to the server– Via the PORT command on the control connectionPORT <IP address, port #>10Creating Data Connection (cont)• Then, the server initiates the data connection– Connects to the socket on the client machine– Client accepts to complete the connection• Data now flows along second connection; first connection remains open for more commands/replies611FTP Communication OverviewFileSystemServerPIServerDTPUserDTPFileSystemUserPIUserInterfaceUserCommand ConnectionData ConnectionProtocol Interpreter (PI)Data Transfer Protocol (DTP)tcp/21tcp/20tcp/randomtcp/randomServerClient12Why Out-of-Band Control?• Avoids need to mark end of data transfer– Data transfer ends by closing data connection– Control connection stays up• Can abort a transfer without killing control connection– Avoids requiring the user to log in again– Done with an ABOR on the control connection• Third-party file transfer between two hosts– Data connection could go to a different hosto Send a different client IP address to the servero e.g., user coordinates transfer between two servers– However: Rarely needed and presents security issues713Example• Traffic captured usingtcpdump -s 0 -w ftp.trace host ftp.ee.lbl.gov• Issue commandftp ftp.ee.lbl.gov14What It Looks Like to the User• Issue commandftp ftp.ee.lbl.gov% ftp ftp.ee.lbl.govConnected to ee.lbl.gov. 220-NOTICE TO USERSThis computer is a Federal computer system and is the propertyof the United States Government. It is for authorized use only.Users (authorized or unauthorized) have no explicit or implicitexpectation of privacy.[…]LOG OFF IMMEDIATELY if you do not agree to the conditions statedin this warning.Your ip address is 128.32.48.169The local time is Wed Sep 27 15:04:44 2006220 131.243.1.10 FTP server readyName (ftp.ee.lbl.gov:ee122): anonymous331 Anonymous login ok, send your complete email address as your password.815Password:230 Anonymous access granted, restrictions apply. Remote system type is UNIX.Using binary mode to transfer files. ftp> pwd257 "/" is current directory.ftp>16ftp> ls bro*200 PORT command successful150 Opening ASCII mode data connection for file listbro-0.9-current.tar.gz.OLDbro-0.9a7.tar.gzbro-0.9a8.tar.gzbro-0.9a9.tar.gzbro-change-log.txtbro-libidmef-0.7.2-modified.tar.gzbro-pub-0.7-stable.tar.gzbro-pub-0.8-stable.tar.gzbro-pub-0.8a87.tar.gzbro-pub-0.8a88.tar.gzbro-pub-0.9a4.tar.gzbro-pub-0.9a4a.tar.gz226 Transfer complete.remote: bro*283 bytes received in 0.0013 seconds (218.37 Kbytes/s)ftp>917ftp> get bro-0.9a9.tar.gz.TYPO200 PORT command successful550 bro-0.9a9.tar.gz.TYPO: No such file or directoryftp> get bro-0.9a9.tar.gz200 PORT command successful150 Opening BINARY mode data connection for bro-0.9a9.tar.gz (3440652 bytes)226 Transfer complete.local: bro-0.9a9.tar.gz remote: bro-0.9a9.tar.gz3440652 bytes received in 0.81 seconds (4161.86 Kbytes/s)ftp> cd ..250 CWD command successfulftp> pwd257 "/" is current directory.ftp> cd secret-files550 secret-files: No such file or directoryftp> quit221 Goodbye.18What It Looks Like “On The Wire”• Issue commandftp ftp.ee.lbl.gov% ftp ftp.ee.lbl.govServer sends exactly this text:< 220-< NOTICE TO USERS<< This computer is a Federal computer system and is the


View Full Document

Berkeley ELENG 122 - FTP - File Transfer Protocol

Documents in this Course
Lecture 6

Lecture 6

22 pages

Wireless

Wireless

16 pages

Links

Links

21 pages

Ethernet

Ethernet

10 pages

routing

routing

11 pages

Links

Links

7 pages

Switches

Switches

30 pages

Multicast

Multicast

36 pages

Switches

Switches

18 pages

Security

Security

16 pages

Switches

Switches

18 pages

Lecture 1

Lecture 1

56 pages

OPNET

OPNET

5 pages

Lecture 4

Lecture 4

16 pages

Ethernet

Ethernet

65 pages

Models

Models

30 pages

TCP

TCP

16 pages

Wireless

Wireless

48 pages

Load more
Download FTP - File Transfer Protocol
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view FTP - File Transfer Protocol and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view FTP - File Transfer Protocol 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?