Programming Assignment 4 -- Design and Implementation of an Application Level Protocol

Computer Networks
Spring, 2010
due:  May 9 (midnight)

For your fourth programming assignment, you will design and implement an application level protocol.  Here are two suggestions for problems to work on:

1.  Implement a multiplayer networked game. You may choose any game that you want, but it should have these characteristics:

I will provide a simple game to illustrate some of the issues involved.

The program is of necessity event-driven. At any given moment, the program may need to respond to GUI events (mouse clicks, etc.) or network events (receipt of a message).  This lends itself to a thread-based model of computation.  Java already uses a thread to respond to GUI events; it is called the event thread.  It is essential that the event thread not be blocked.  You need to write one or more threads that will respond to network events.  In my example program, I used three threads, one for each blocking network call made by the program:  a thread to listen for connections, a thread to make a remote connection, and a thread to read data from a connected socket.

My program is a networked implementation of the familiar "Rock Paper Scissors" game.  I've placed the code in a jar file RPS.jar that you may download.  It consists of the following Java files:

  1. NAME <name>
  2. PLAY <choice>
  3. QUIT

2.  Implement a Distributed Hash Table using the Chord or Kademlia system.
Here are two references to papers on Chord and Kademlia:

Chord:  A Scalable Peer-to-peer Lookup Protocol for Internet Applications

Kademlia:  A Peer-to-peer Information System Based on the XOR Metric