CS 15-441 Fall '01
Project 1

Project 1 ( P1.ps, P1.pdf Sample Solutions )

Due: Tuesday, Sept. 25, 5PM

Changelog

  • 09/12/01, 12 noon :- Added hint about include files
  • 09/16/01, 1.30 a.m. :- Changed the wget example
  • 09/16/01, 1.35 a.m. :- Added a new Q&A about testing STOR
  • 09/24/01, 11.00 a.m.:- Added update about abort
  • 10/10/01, 10.00 p.m.:- Added Sample Solutions

    Hints

    Questions and Answers:

    1. Who should I turn to if I have questions regarding this project?

      • The best place to post your query is the class bbs at cyrus.academic.cs.15-441

        The TAs all read the bbs regularly and will answer your query promptly. Also, your query can also be answered by other students who know the answer.

    2. Is this an individual assignment?

      • yes

    3. What do I use to test my server with?

      • wget on the Solaris machines. There is also a modified version of wget which sends the QUIT command on closing (as explained above). This version of wget is available here.

    4. when a connection is done with the 'port' command, is everything (socket creation down to connect) done after the 'retr' call? I'd been doing the socket creation in 'port' but realized that I do not know what error to return.

      • This is explained in Section 2.2 and 2.3 in the assignment writeup. Basically, what happens is this.

        client sends PORT command to the server.

        client sends RETR command to the server.

        The server responds with a "150 attempting to send file" message (you can change the exact message but the code should be 150.

        The server then tries to connect to the clients port. It returns a 425 error message if the connection failed or 426 if the connection was broken halfway. it returns 451 or 551 if it had problems reading the file (no such file etc.) and 226 if the transfer was successful.

        For PASV mode, you may want to start a timer after the server sends the 150 mark. Otherwise, if the client does not actually connect to the server, that particular server process may be stuck waiting for a connection. If the timer expires, you can return a 425 error message. You can do this in other ways too. It's up to you.

    5. second, how can we test error handling? like making sure that my program responds correctly to an ftp client trying to get a file before logging in?

      Can you explain what you will be looking for on error checking so I can make sure my code is as robust as expected?

      • What I had in mind to test were the following

        1) server must work with correct commands

        2) server must not crash when sent strange / unrecognized commands

        3) server must not crash when asked to send strange files / connect to strange ports etc.

        4) server must be able to handle things like the client closing its connection unexpectedly (even during data transfers)

        for 2) and 3), the server should send an appropriate error message (as given in Section 2.5) to the client.

    6. How do I test STOR?

      • Use the normal ftp client on the solaris machines.

        e.g., ftp unix4.andrew.cmu.edu

        then use the user command to log in and the put command to store a file

    Revisions and Updates:

    1. The default root directory should be /tmp and not ./tmp as mentioned in Section 1.

    2. The password command the server receives from the client is

      PASS "password"

      and not

      PASSWORD "password".

      Section 2.1 has it wrong. Refer to the example in Section 3. for the exact strings sent by the client.

    3. The store command should be

      STOR "name_of_file"

      and not

      STORE "name_of_file" (as stated in the project description)

    4. The abort command should be

      ABOR

      and not

      ABORT (as stated in the project description)

    Back to CS 15-441 home page.