ECE361H1S Lab 3 - Text Conferencing.pdf

5 Pages
Unlock Document

Electrical & Computer Engineering
Robert Brym

This is the official lab specifications ECE361H1S Computer Networks I Lab 3: Text Conferencing Due Date March 31 , 2013. 5pm Project Goal This assignment will give you hands-on experience with socket programming in Java. You will be using Java ServerSocket and Socket to implement a simple conference application similar to IRC or MSN. Project Description In this lab, you will create a server application and a client application that works with it. A conferencing application consists of a server, which registers users and several client nodes, as the end points for a particular conference session. The clients may be located on different networks. TCP will be used to allow communications between the clients and the server. Each client has a unique name referred to as the identifier (a user ID of type Integer, or a user name of type String). The ID of a node is unique among all participating nodes. When a client first registers with the server, it must also submit its ID. Upon registration, the server will create a binding between the client ID and its IP address. Remember that IP addresses are not always static, nor is the user name associated with a particular computer. Your server should therefore be able to handle changes in IP address for a given ID. This does not need to be complicated. Hint: the server does not need to keep the registration information after a client logs out. When a client wishes to communicate with other clients, it must create a conference session on the server. A conference session is simply a list of clients (at least one) that are sending text messages to one another. Messages sent by a single user should be seen by all participating clients in the same conference session. It is the server’s responsibility to multicast the text data to all participating clients. You will be implementing both the server and the client application. To help you get started, some class definitions, together with this handout, will be provided. The protocol specification described in the sections that follow is very flexible; and you may make changes as you see fit. TCP socket tutorial Oracle provides official documentations on all aspects of Java programming. Specifically, the following link offers an introduction on Java TCP socket programming with examples. Pay attention to the example code as it shows you how to program server in a multi-threaded fashion. This is the official lab specifications Protocol The following protocol is only a suggestion. Feel free to amend, or even use a completely different protocol. In our formulation, there are two types of messages: data and control messages. Control messages are used for registration, address resolution, session creation, invitation, and termination. Since you are using TCP, you do not need to use acknowledgements for reliability on the transportation layer. However, application layer acknowledgements may still be necessary. Therefore, we might need acknowledgements for success/failure conditions at the server, e.g. was registration successful, or did someone already take the same user name? Consider following structure for the data and control messages. Public class Package { Public emun PackageType{ REG, REG_ACK, // and etc. } PacketType type; int dataLength; String username; String data; }; The type indicates the type of the message. There are various types of messages in this assignment. They are described in the table below. Thlength field should be used to identify the length of the payload, i.e., the length of dauserName field contains the client name (or user ID if you choose to use integers as IDs) of the client sending the message. The following table shows all control packets: id packet data function REG Register with the server REG_ACK Acknowledge successful registration REG_NACK Negative acknowledgement of registration DREG Deregister from the server JOIN Join a conference session JOIN_ACK Acknowledge successful conference session join JOIN_NACK Negative acknowledgement of joining the session DET Leave a conference session CONF Create new conference session CONF_ACK Acknowledge new conference session and return session ID INV Invite a client to join a session INV_ACK User invited to a session successfully INV_NACK User doesn’t exist, or is already in another session Send a message to the session or display the message if it is MSG received This is the official lab specifications QRY Get a list o
More Less

Related notes for ECE385H1

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.