Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE 4110 – Internetwork Programming File Transfer Protocol (FTP)

Similar presentations


Presentation on theme: "ECE 4110 – Internetwork Programming File Transfer Protocol (FTP)"— Presentation transcript:

1 ECE 4110 – Internetwork Programming File Transfer Protocol (FTP)

2 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 2 Introduction FTP is based on TCP. Uses two simultaneous TCP connections. Server port 21 is used for control, server port 20 for data transfers.

3 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 3 Control Connection 1. Server socket code puts server port 21 in passive open state “listen” 2. Client socket executes an active open by sending SYN and supplies an ephemeral port (E.g., port 62010)

4 4 * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall Control Connection (cont’d)

5 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 5 Data Connection 1. Client, not the server, issues a passive open using ephemeral port (E.g., 63000). 2. Client sends this port number to server using control connection. 3. Server receives port number and indicates active open (3 way handshake) from port 20 to the client ephemeral port received (63000 in our example).

6 6 Data Connection (cont’d)

7 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 7 Control and Data Connections

8 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 8 Command Processing In ASCII uppercase. May be followed by an argument. Six groups: 1. Access commands 2. File management commands 3. Data formatting commands 4. Port defining commands 5. File transferring commands 6. Miscellaneous commands Every command creates one or more responses.

9 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 9 Command Processing (cont’d) Most commonly used commands and responses: CommandTypeMeaning 220ResponseService ready USERAccess commandUser name 331ResponseUser name OK, Password? PASSAccess commandPassword 230ResponseUser login OK SYSTMiscAsk about OS Type IData format commandDefine file type image

10 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 10 Command Processing (cont’d) CommandTypeMeaning 200ResponseCommand OK PORTPort defining comm.Client chooses port RETRFile transfer commandRetrieve files 150ResponseFile status OK 226ResponseClosing data connection QUITAccess commandLogout 221ResponseService closing

11 11 Example: Retrieving Directory Listing

12 12 Example: Storing a Binary File


Download ppt "ECE 4110 – Internetwork Programming File Transfer Protocol (FTP)"

Similar presentations


Ads by Google