WMich Home

 

CS Home

 

Ajay Gupta's Home

 

CS555 Home
Class Policies  & Syllabus
Topics Covered
Home Work I
Home Work II
Home Work III
Home Work IV
Home Work V
Home Work VI
 
 
 
 
 
Message  Board
Class List
Reading List

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Email webmaster

 

 

 

 

CS 555 - Computer Networks

HW3

Spring 2005

 

Given February 1, 2005

Due February 15, 2005 (class time)

Simple Internet Chat Room

This programming assignment will require heavy use of the Berkeley UNIX Networking facilities (often called The BSD Socket Interface). You will use the socket interface to implement a simple, Internet chat room services. Your implementation will consist of both a client and a server application. The client can allow users to login, send messages to other active users, and receive messages from other active users, logout, and quit the chat room. The server verifies the identity of the users, forwards the message to the destination, and monitors clients’ activities.

Write two programs, a server and a client. The server creates a socket in the Internet domain bound to port SERVER_PORT (a constant you should define in both programs, you may use last 4 digits of your WMU-ID or your SSN). The server receives requests through this socket, acts on those requests, and returns the results to the requester. The client will also create a socket in the Internet domain, send requests to the SERVER_PORT of a computer specified on the command-line, and receive responses through this socket from a server.

For this assignment, you just need to allow one active client connect to the server. In the next assignment, you will allow multiple clients to connect to the server (via multithreading) at the same time. You will need to implement the following commands on the client side and the corresponding functionality on the server side.

1. login [UserID] [Password]

Identify yourself to the remote talk server. If the UserID is not specified, the client will prompt the user for it. If the Password is not specified, the client will prompt the user for it. If the user is authorized (i.e., the UserID and the Password match), the server will send a confirmation message to the client; otherwise, the server will send an error message to the client.

2. send

Send a message to the remote server. When a server receives a message, it will reply to the client with the same message preceded by the UserID.

3. New

Create a new user account. The length of both the UserID and Password should be between 3 and 13 ASCII characters. The users’ information should be kept in a permanent media, such as a file.

4. logout

Logout from the remote server. A user is not allowed to send any message after logout.

5. quit

Terminate the talk session with the remote server. The client exits when it receives the confirmation message from the server.

Programming Environment
You can use either C/C++ or Java to implement the assignment. The assignment will be tested on the Linux / Unix workstations. For easy grading, please don’t use any GUI interface.

Requirements

The following items are required for full-credit: Implement all five commands: login, send, new, logout, and quit. Authorization information should be maintained by the server. You must have the following users (case insensitive) in your system:

UserID    Password

Daman   Auvenshine
Saad      Bader
Wai        Choy
Eric        Dekoekkoek
Ryan      Galbraith
Terry      Goodman
Garrett   Huyser
Venkat   Kalvala
Chris      Littell
Shan      Rathinakumar
Joshua  Rowe
Ben       Slater
Gopi      Vignarajah
 

·A user can only send the message to the server after its identity has been verified by the server.

Both the server and client should be able to run on any linux / unix workstations in the cs department or CAE labs..

The client should be able to connect to the server running on any machine. Therefore, the server IP address should be a command line parameter.

The server should output all client activities on the screen.

When the previous client exits, the server should allow the next client connect without restarting the server.

Your source codes must be well documented and commented

Include a README file in your submission. The following information should be included: functions that have been implemented, instructions about how to run your program, known bugs, and sample outputs.

Include a Makefile in your submission. Your Makefile might be the exact same as the sample Makefile if your file names are the same as those of the sample codes. However, you may want to use more meaningful names and modify the Makefile appropriately.

Grading (150 points)

Correctness and Robustness (120 points)

o You will lose at least 10 points for any bugs that cause the system crash.

o You will lose 5 points for any other bugs.

Comments and style (10 points)

README and Makefile (10 points)

Design and Performance (10 points)

o Limit the communication between the client and the server. If something can be done locally at the client side, you should not ask the server to do it. For example, checking the validity of a user command should be done at the client side.

o Don’t make the client a dummy terminal.

Sample output

Sample client outputs, the words in bold are the user inputs.

csy02:~/cs555/hw3% clientTalk 141.218.143.217

Simple Internet Chat Room: HW3: Computer Networks

Here, list commands available for the users, and instructions.

chat>send

Permission denied, you must login first.

chat>login

UserID: tERRY

Password: GooDmAN

SERVER# Terry joined the chat room

chat>send

Please input your message:

Hello, Everyone

SERVER#Terry: Hello, Everyone

chat>send

Please input your message:

Good Bye

SERVER#Terry: Good Bye

chat> quit

SERVER#Terry has left the chat room

csy02:~/cs555/hw3%

Be creative in your design.

Hints

Start early. These programs will not be very long, but they may be difficult to write, and they will certainly be difficult to debug.

Download the sample codes, compile and run them, try to understand every detail, and then make the changes.

Design your own communication protocols between the client and the server.

Submission Instruction

(1) Copy all your files (only source codes, data file, README, and Makefile, no object file and executable file) in a directory. The directory should be named like hw3_cs555_yourlastname/. For example, if you name is John Smith, your directory name should be hw3_cs555_smith/..

(2) Generate a tar file of the directory using the following command.

Go to the parent directory of your hw3_cs555_yourlastname directory and type

% tar cvf hw3_cs555_yourlastname_mmddyy.tar hw3_cs555_yourlastname

%gzip hw3_cs555_yourlastname_mmddyy.tar

Note, only the zipped tar file will be accepted. You are fully responsible for generating the right tar file.


(3) Email the tar file before the due date to ajay.gupta@wmich.edu

(4) Submit a hardcopy of your submission with README file on top.

 

Sample Programs and Makefiles

Java examples (except makefile) were covered in class - see class notes. Following will help you, if you want to use C/C++

1.talkClient.c

2. talkServer.c

3. Makefile

4. Makefile for Java

References

1. Beej's Guide to Network Programming: Using Internet Sockets

2. Sun Programming Interfaces Guide: Socket Interfaces

3. How to write a Makefile

4. Sockets programming in Java: A tutorial

Any student may be asked to show and discuss his implementation in class, so be ready with your presentation.

Submit a zipped file of your source codes, scripts (to run your program) and report along with a hardcopy of your source codes, scripts, a couple of sample executions of your solution and report.

Use <hw#cs555_yourlastname_mmddyy.{zip,gz,ppt}> as the naming convention for your zipped or ppt files when emailing your submission to ajay.gupta@wmich.edu. Replace '#' with the appropriate homework number.

REMINDER: You are responsible for making yourself aware of and understanding the policies and procedures in the undergraduate (pp. 268-270) [Graduate (pp. 24-26)] Catalog that pertain to Academic Integrity. Additionally, easy availability of information, material, source codes, lecture notes etc on the Internet may make it possible to find solutions to your assignments on the Internet or elsewhere. It is okay to refer to those, understand them and use them to enhance your solutions, generate your own ideas etc. However, you must give proper and full credit to original authors of the work, if you include their ideas. Failing to do so is part of academic and professional dishonesty. It will not be tolerated in this class. Do not give in to temptations...

 

 

 

 


Home