It's very simple. You want/need both extra points and hands on experience with UNIX file and network I/O. This mini-lab addresses these issues.

This mini-lab is due December 11th at 11:55 PM.

There are two parts to the lab. Each is worth 3 points.

Each part will be graded primarliy based on three qualities: your submission works for simple cases, it works efficiently, and it works for large cases.

UPDATE (12/12/04 12:12PM): GRADES

Sorry. These would have been posted sooner if I hadn't fallen asleep for a couple of hours. The files used to test your submissions are posted in the files directories found below. The grades file, which is linked to above, contains a breakdown of everyone's grade. There are 5 sections (a through e). Sections a, b, and c are for part 1 and are worth one point each. Sections d and e are for part 2 and are worth one and a half points each. Where important, I noted why points were deducted. If you have any questions, feel free to ask.

UPDATE (12/11/04): Submit procedure

Tar your source files up and email them to dmrenie at cs dot umd dot edu with the subject: CMSC311 LAB

As the lab is due Saturday at 11:55PM, I will check the submissions at midnight and send confirmation emails in reply. If you do not get a confirmation email by 1AM Sunday, please contact me.

UPDATE (12/08/04): Files for part 1 and part 2.

Part 1

This is to get you warmed up. A list of filenames will appear as arguments on the command line. You should create new files called "min", "max", and "summary" with the following contents:

min - contains a copy of the smallest file

max - contains a copy of the largest file

summary - The first line in the file should be "summary for num files" where num is the number of file entries in the summary file. Then there should be a list of file entries of the following form for each file (these file entries do not need to be in any particular order): "filename offset_of_first_x". If a file contains a byte 'x', (or 120 or 0x78, if you prefer decimal or hex), offset_of_first_x will be the smallest byte offset that contains the value 'x'. Otherwise, it will be -1. Every line should have a newline character at the end of it.

Note: The contents of all files other than min, max, and summary should remain unchanged. There will also be only one potential min or max.

Part 2

This is where things get a little interesting.

You will write a simple server. This is what you will be submitting.

There will be a single argument on the command line - the port number that your server should listen on.

Clients will connect to the server, send a command, receive an acknowledgement, and then disconnect. There are two commands: PUT and GET. Some details:

PUT - The format of a PUT command will be "PUT message". message will be newline-terminated. Your server should store this message and all other messages which have been sent. Your server must respond to the client by sending "OK". The OK message should be newline-terminated. Upon receiving this acknowledgement, the client will immediately disconnect.

GET - The format of a GET command will be "GET". The GET command will be newline-terminated. Your server should send a list of the messages it has received via PUT commands and end with the line, "OK". The OK line should be newline-terminated. Each line in the list will be a different messsage that your server received via a PUT command. Each line should be newline-terminated.

UPDATE (12/06/04): The maximum length of a message, including the newline character, is 80 characters.

Check back

More details will follow in the next few days (such as the submission method, and some test data). The above description should be enough to get you started.

Copyright 2004 David Renie