FTP – File Transfer Protocol

CISC 856-010: TCP/IP and Upper Layer Protocols

Due: April20, 2010

Contact: Bo Xu–

(Thanks to Brian Lucas, Umakanth Puppala, Vikram Rajan, Michael Haggerty and Shriram Ganesh for the basis of this assignment. Thanks to professor Amer for the help and suggestions.)

Part 1

Read Chapter21 in TCP/IP Protocol Suite by Forouzan

  1. Complete online quiz for Chapter 21 and submit answers to Professor Amer
  2. Turn in answers for problems:1, 5, 8, 9, 11, 15.
  3. Turn in answers for the following questions:

a.Why does FTP sometimes work in passive mode when FTP doesn’t work in active mode?

b.What FTP mode does File eXchange protocol(FXP) use? Why?

Part 2 – Understanding FTP Connections

In this assignment, all the students could connect to ftp.udel.edu an anonymous server, in which your username should be “anonymous” and the password is an email address.

You should ‘put’ your client.txt file in /cisc856 and do your ‘get’ or ‘mget’ in the directory /pub/cisc856, in which professor Amer has already created 3 files: server1.txt, server2.txt and server3.txt

The name of the files that you ‘put’ should have the following format: client_YOURNAME.txt. For example, my name is Bo, so the file which I put should be client_bo.txt.

NOTE:

You may want to run Wireshark on your own computer(if you “ssh” to the machines in the lab for this homework, you could not see the content of the packets) to capture the PDUs and analyze them carefully.Because the authority limitation, we have to implement the commands in different directories as I mentioned above.Create a small size file on ftp client and name the fileclient_YOURNAME.txt.

  1. Start Wireshark on the data-collection machine (your own computer) to monitor all traffic between the client and the FTP server.
  2. From the client machine, ftp to the server

ftp –d servername

[the –d flag turns on client debugging]

  1. Upload the file client_YOURNAME.txt to the server(use the command cd directory to change the path to /cisc856or /pub/cisc856)

put client_YOURNAME.txt

  1. Download the file server1.txt from the server

get server1.txt

  1. Then download all the server*.txt files from the server

mget *.txt

Pay attention to what happens when the mget command is used. You should notice that several data connections are used. First mget causes the server to send a list (NLST) of all files that the client specified (all .txt files beginning with “server”) to the client, and then the client will ask you, the user, one at a time, if you want a file. Each of those “yes” choices will cause a new data connection to be established, transferring a single file (and then closing the data connection, and repeating for each subsequent “yes”).

  1. Toggle your client-serverfrom active mode to passive mode by entering the following command
    passive
  2. Repeat steps 3 - 5 (make note in the Wireshark when the switch to passive mode occurs).
  3. Exit ftp and then close Wireshark.

Turn in an annotated transcript of your Wireshark output and the user sessionalong with the answers to the following questions:

  1. Indicate where in the Wiresharkany control connection(s) is(are)opened/closed.
  2. Annotate the PDUs containing your username “anonymous” and password “email address” being sent over the control connection.
  3. Indicate each data connection in the Wireshark outputusing different colors, and explain what “data” is being transferred over each connection. Also you need to use analogous colors to highlight the user session to match the Wireshark output.
  4. How many data connections were opened/closed? (Highlight their different port numbers.)
  5. Who (server or client) initiates each connection? The FTP RFC states that the server opens the data connection. If you witness the client opening a data connection, explain why.
  6. What happens when the Client Protocol Interpreter receives the command put client_YOURNAME.txt from the User Interface? How does the Server Protocol Interpreter respond? Assume active mode.