TCP/IP | Assignment 2(ftp-client) | Due according to syllabus ---------------------------------------------------------------- The 2nd assignment is to use TCP from the client point of view, and implement a simple FTP client. RFCs 959 and 1123 are fundamental references here. The FTP client should operate as a shell. It should be able to talk to any FTP server on the Internet, and allow you to login either anonymously or as a user with a "shell" account. We will call this application "hbftp" for homebrew-ftp. Fundamental references: 1. Stevens TCP/IP Illustrated, Volume 1, Chapter 27. 2. http://www.cs.pdx.edu/~jrb/tcpip/lectures/ftp/index.html 3. RFCs 959/1123 4. BSD ftp client in debug mode The FTP client should have conceptually 3 parts, TCP connection abilities including of course use of gethostbyname(3) for DNS lookup. This consists of a TCP socket/connect/and i/o calls and DNS gethostbyname call. In addition, we should have an FTP protocol handler that uses the FTP protocol, and at the highest-level a shell that reads user input lines and translates them into FTP protocol requests. Architecture: FTP client-side user interface including invocation --------------------------------------- FTP protocol mechanism ----------------------- TCP socket calls The user interface should be invoked as follows: (shell) hbftp (no parameters) It should login/connect to an ftp server as follows (using an (hbftp) prompt: (hbftp) connect This will cause a TCP connection and subsequent FTP-level login to the remote account. Note that this supports both anonymous-style and user-style login. If you do not have a user-account anywhere, you can always pick an anonymous ftp site to login to (e.g., ftp.cs.pdx.edu). anonymous ftp login: user=ftp, password=you@somewhere.edu Other required hbftp commands are: (hbftp) read remote-file Transfer a file in BINARY mode from the remote site to this (client) site. This is essentially a FTP RETR, although that is of course not all of it. (hbftp) write remote-file Transfer a file in BINARY mode from the client to the server. (hbftp) delete file delete a file on the server. (hbftp) cd /pathname chdir on the server (hbftp) lcd /pathname chdir on the client (hbftp) list list files on the server. This can be in any format you like. (hbftp) exit quit the client. optional: (hbftp) ! You can and should do this on unix systems. If you see a ! as a verb, just pass the rest to system(3). If you are WNT-based ... forget it, although maybe you can invoke "command.com" (no idea ...). Turn in at class (see syllabus for due date): 1. src listings 2. makefile 3. script output roughly show your test plan as captured with script (or printfs) via client side runs. 4. architecture description describe in ENGLISH the overall implementation of your protocol. This is an important part and will be the first thing the instructor/grader reads. Be sure and justify your decisions. Explain both FTP architecture and local o.s. system calls used. 5. test plan This should consist of a set of test cases where you list each test, describe what it does, and describe what results you expect. Your script output should reflect a run of your test plan. You may put tests in the test plan, that you cannot execute. Justify them and clearly state that you cannot execute the test. ALSO turn in all of the above via e-mail to the instructor or grader as a shar listing. You turn in two things. 1. printed version at class. 2. email version using shar. The shar email version will be used for deciding lateness.