CS357 Assignment 2 - UDP Socket Programming

Winter Session 2004




Purpose of the Assignment

This assignment is designed to test your abilities to:

Assigned

Tuesday, January 25, 2005 (please check the main course website regularly for any updates or revisions)

Due

Monday, February 14, 2005 by midnight in the CS357b assignment locker (locker 85, MC basement near the Grad Club). Electronic submission must also have occurred by that time.

Late Penalty

5% of the total assignment value per day. If the assignment is not submitted within 5 days of the due date, it will not be graded. You are required to hand in a completed Assignment Submission Form (available from on the course website) with your assignment. If you are using late coupons toward this assignment, you must indicate the number on your submission form.

Individual Effort

Your assignment is expected to be your own work. Feel free to discuss ideas with others in the class; however, your solutions should be your own work. If it is determined that you are guilty of cheating on the assignment, you will receive a grade of zero, and you may be penalized further by the value of the assignment. That is: this assignment is worth 10% of the overall mark; if you cheat, you could receive a grade of -10%, and your maximum possible mark in the course would be 80%.

What to Hand in

You will submit a paper copy of all code, header files, Makefiles and test results to the assignment locker. Submit your assignment in a 9" by 12" envelope that has the course name, your name and your student number, as well as the assignment number, on the outside. With your assignment, you must include a CS357b Assignment Submission Form, on which you declare that the material you are handing in is exclusively your own work.

In order to retrieve your assignment once it is marked, you need to print an "Assignment Ticket", and include it with your submission. To find out more about this process, check the Computer Science Department FAQ under the question "How do I get my assignment back from the I/O counter?".

As well, you are required to submit your program electronically. You must store all of the code, headers, Makefiles, and test results for your assignment in a directory called Assignment2. From the directory that contains Assignment2 as a subdirectory, you will issue the command:

submit cs357 Assignment2

to submit your assignment electronically. If you've done it right, you'll receive an e-mail confirming the fact shortly afterward. You are reminded that the department reserves the right to use similarity detection software in an effort to detect cases of plagiarism and other forms of cheating.

The TAs may run your electronically-submitted programs against some test cases that meet the parameters of this assignment. Be sure to test your program well to ensure that it is working properly!

Assignment Task

You are required to implement in C or C++ a stripped down and simplified instant messaging client and server for our Solaris lab environments. Before starting to panic, keep in mind that this software is in essence very simple. We are also going to be building this application up slowly and deliberately over the remaining assignments in this course, adding broadcasting support in Assignment 3, and multicasting support in Assignment 4.

For this assignment, we are focussing on the basic client and server functionality required for a simple instant messaging application. Clients will be able to register and deregister with the server, and clients will be able to send instant messages to one another through the server. The messages will be text only, with no file attachments, images, and so on that you might find in a modern messaging application.

Part I -- The Instant Messaging Client

Here are some specific requirements and other important notes about your instant messaging client:

Part II -- The Instant Messaging Server

Here are some specific requirements and other important notes about your instant messaging server:

Part III -- Some Final Notes and Hints

Here are some hints to help you in your assignment:

You are to write all of the C or C++ code for this assignment yourself. In addition to your own code, you may only use the C source code provided in the course notes, or the code on this web page, in your programs. (If you choose to do so, you must cite its use in comments where appropriate!) You are not allowed to use C functions such as system() or anything similar to execute other programs for you! All server code files and header files must begin with ims, and all client files must begin with imc. Using a Makefile is required. It will make your life, as well as your marker's, easier in the long run. All of these files must be submitted with your assignment.

As an important note, marks will be allocated for code style. This includes appropriate use of comments and indentation for readability, plus good naming conventions for variables, constants, and functions. Your code should also be well structured (i.e. not all in the main function).

Please remember to test your program as well, since marks will be given for correctness! You should be able to send a variety of different test messages and respond to error conditions appropriately. You must use the script command to capture a session of two clients exchanging messages between one another through the server, and include this with your submission.