Note: For this and all subsequent homeworks and programming assignments, the course directory refers to /afs/engin.umich.edu/class/f99/eecs489. Each homework and programming assignment will have its own subdirectory under the course directory assignments with the name hw1, hw2, pa3, pa4, etc., I will refer to each assignment's directory as the assignment directory. It is possible that there may be bugs in my code. Please let me know asap if you suspect a bug.
If you are new to network programming, study the files server.c and client.c in the assignment directory first. Refer to these files when you are coding the actual project.
There are seven (7) files in the assignment directory in addition to server.c and client.c. The server side code (turnind.c and tind_recv.c), a skeleton of the client side code (turnin.c), their shared header ( turnin.h), a solution code object file (_turnin.o), the make file ( Makefile ), and an info text file (info). In case you were wondering, the "d" postfix stands for "daemon" which means "server".
You will modify info, turnin.c and tind_recv.c to complete the project. In turnin.c you will replace five (5) extern calls to the solution object file with your own code. Then you will modify the server function tind_recv() which has been extracted into the file tind_recv.c for convenience. Info is self-explanatory. More on these modifications later. Read the comment blocks before the functions for additional implementation information.
To see how the program works:
1. Open a local shell and go to your working directory.
2. Type make to make the two executable files turnin
and turnind.
3. Move the executable turnind into a new directory named,
say, daemon.
4. Make another subdirectory in daemon named hw1.
5. Telnet to another unix box, say, xor.engin.umich.edu.
6. On xor fire up the daemon by executing turnind
in the daemon directory.
7. From your local shell type :
turnin -s xor.engin.umich.edu -p 4898 -i 1234 hw1 tind_recv.c
turnin.c info
(This is the same command you will use to submit your project except
the server name will be the box we are running our server on.)
8. If this worked, the files tind_recv.c, turnin.c,
info and a new file named SID.txt should be found in
the directory daemon/hw1/<unique name> and you should have
gotten a message from the client saying 3 files were received.
% turnin -s <servername> -p <port#> -i <last 4 ss#s> assignment files...where servername is the name of unix box running the server (ie xor.engin.umich.edu) and the port number is 4898 (it's arbitrary). The assignment is one of hw1, hw2, hw3, hw4, pa1, pa2, pa3, pa4, pa5, and pa6. The files... are the files you are turning in.
You can turn in a file as many times as you want. The server overwrites any existing file with the same name with the new copy. Note that someone masquerading as you can clobber your files. So, keep a local copy of everything you turn in.
The server expects to receive the following in order: First, a turnin header that tells the server three things: (1) the assignment for which you are turning in files, (2) your uniqname, and (3) the number of files you are turning in. Fig. 1 shows this header in pictorial form. It is defined in turnin.h as the _tin_head structure.
Next, for each file you turn in, you must first send a file header depicted in Fig. 2 (and found in turnin.h as the _tif_head structure) to tell the server what to expect. After you send the file header, you can send the file in chunk(s) of TIN_DLEN bytes, as defined in turnin.h.
When you're done sending, the server will reply with a message (of maximum size TIN_MLEN bytes--again, as defined in turnin.h) telling you what it has received, or what error it has encountered. Your client must be prepared to receive this message and print it out.
Notes on the student id field: Suppose your SS number is 123-45-6789-0. That field would then contain the string 6789. Hint: Be careful to note that the course and your student id numbers are sent as strings while the number of files field is sent as a binary number!
% turnin -s kailash.eecs.umich.edu -p 4898 -i 1234 hw1 tind_recv.c turin.c info
kailash.eecs.umich.edu is the name of my machine where I will run the turnind server. We will assume the default port number 4898 as the well-known port of the server. Note that the server on kailash.eecs.umich.edu will not be running until 9/22/99. Run a turnind server on your localhost to test your code.
Questions on this assignment can be posed in the news group. Open Netscape and then select Communicator > Collabra Discussions. Right click on news and select add discussion group. Then join umich.eecs.class.489. Answers to your questions may already be there!!!