CS547/CS490-Network Programming Project Specification/Assignment #1
CS547/CS490-Network Programming Project Specification/Assignment #1
Project Specification/Assignment #1
Assignment 1 - Narrative:
The goal of Phase I is to establish a socket connection between a server and clients. The server
process is supposed to be started at one of the PCs before any client makes a connection request.
Client processes should be started at different PCs. A client process should take one argument as its
client ID when it is started. For example, if your program name of the client process is “client”, then
type “client <client ID>” at the DOS prompt to initiate a client process. The <client ID> should be an
integer ranging 1 through 3 (this means your sever must take 3 client processes and none of the
requests from the three clients should be dropped). After a client process is started, it should prompt a
user to enter the IP address and the port # of the server process. Each time the server receives a
connection request from a client, the server process should display a message, “a connection request
arrived!” on its monitor. After a socket connection is successfully established, the client process
should send its client ID. The server process should receive the message (i.e., the client ID) and
display the following message, “Request from client #.”, where # is the ID of the requesting client.
After the server process displays the client ID, the server returns the current timestamp to the
requesting client. The server process should wait for about one second after it returns the timestamp
to the client. The client should receive the timestamp and display it on its local monitor. After the
client received the timestamp, the client should disconnect the socket connection and repeat the whole
process from the beginning. Each client should be designed to repeat this procedure 5 times and after
5 repeats, it should terminate itself. For each repeat, the client process should wait for one second. In
the server side, execution should go back to “accept” function call. During the process, no connection
requests from clients should be dropped (i.e., waiting clients should be served in the arriving order
(First-Come-First-Serve order).
Technical Issues:
For socket connection to be established, the following specifications should be satisfied:
(1) Network protocol: Internet Protocol (IP)
(2) Connection type: connection-oriented socket (stream socket = TCP)
(3) The format of the timestamp is HH:MM:SS (H: Hour, M: Minute and S: Second).
Flow Chart:
CLIENT 3 clients
SERVER
Socket
Socket
Bind
Listen
Wait 1 sec.
Close
Wait 1 sec.
End
Testing:
Testing will be performed using three PCs. The server process is going to run at a PC, two clients will
be run at another PC and the third PC will be used for the third client process. All the outputs should
be as expected and no connection request should be dropped until the end of the test.