Northeastern University

CS 4700/5700 - Fundamentals of Computer Networks

Problem Set 1: Socket Programming

Work to be done in teams of two students.

Due date: 11:59PM EST, January 23, 2012.

Late submissions will result in a 10% penalty per day (e.g., 2.5 days late result in 25% penalty)

Sockets Communication

Write a simple client-server broadcast chat application. The server listens at a specified UDP port, and waits for GREETING messages from remote clients. Once a greeting has been received the client may send a MESSAGE command to the server, which will forward the contents in an INCOMING message to every remote point that has previously sent a GREETING.

The client creates a socket which it will maintain throughout its lifetime, and is capable of receiving and sending packets from/to the server.

The types and format of messages to be exchanged in the application are:

  1. GREETING: Greets the server. Client to server only.

  2. MESSAGE text-of-msg: Sends some text to the server for further distribution. Client to server only.

  3. INCOMING text-of-msg ip port: The server has received some text, and is passing it along with the sender's ip and port. Server to client only.

  4. Any other message (e.g. ICMP errors) must be ignored.

You can use either Java or C/C++ to program the application. Here are C sample codes for a udp server and client.

A sample run of your application must work as follows:

Note the following:

Network Diagnostic

On your own machine, install wireshark, a widely used network protocol analyzer. Familiarize yourself with wireshark capabilities. Run the server chat application you developed in the previous section, on login.ccs.neu.edu, and the client on your own machine.

Mechanisms for Reliable Communication