Project 1 -- Error Management


For this project, you will handle some bit-flipping errors introduced during transmission. Specifically, we will simulate communications across different media, some of which introduce different types of error. Your goal will be to write three different data link layers, each performing a different type of error management.


Getting the code

Do your work on romulus, which you can use via an ssh or VNC connection. On that machine, you can copy all of the Java source code files from the following directory:

~sfkaplan/public/cs29/project-1

This code forms a simulator. In this simulator, a partial network stack (using only the layers we've covered so far) is created for each of two hosts, connected by some medium. At runtime, you can select from three possible media:

  1. PerfectWire: Connect two hosts with no errors ever introduced.

  2. LowNoiseWire: Connect two hosts with infrequent, uniformly distributed bit flips.

  3. BurstyNoiseWire: Connect two hosts with infrequent error bursts. During these error bursts, which have a maximum length set by a constant in the class, the probability of bit flips is uniformly distributed and relatively high.

A physical layer object connects directly to the medium. There is only one type of physical layer. It accepts a sequence of bytes which it then sends, one bit at a time, across the medium. The receiving physical layer reconstructs the bytes, one at a time, delivering each complete byte to its data link layer.

Currently, there is only one data link layer: DumbDataLinkLayer. This particular data link layer uses start/stop tags and byte packing to frame any data that its network layer asks it to send. It creates a single frame for any sequence of requested bytes, no matter the length, and most critically, it performs no error management. You will need to write better data link layers (more below on that).

The network layer, of which there is only one type, simply sends a few messages via data link layer, and then (on the other host), receives those messages. Therefore, this network layer is merely a client to drive the data link layers, printing the messages sent a received to verify the accuracy of communication.


Writing new data link layers

You must create three new data link layers that are subclasses of the abstract DataLinkLayer class:

  1. ParityDataLinkLayer: Use a single parity bit per frame to detect errors. When an error occurs, an error message should be printed, the (incorrect) data shown, and the network layer should not be notified of the frame's arrival. A user should be able to specify the string "Parity" at the command line to use this data link layer.

  2. CRCDataLinkLayer: Use the CRC checksum method to detect errors on each frame. As above, when an error occurs, print an error message, show the (incorrect) data, and do not notify the network layer. A user should be able to specify the string "CRC" at the command line to use this data link layer. [Hint: Consult the text to select a generator polynomial to drive your CRC. Be sure that you choose one that can handle burst errors at least as long as those that the BurstyNoiseWire can introduce.]

  3. HammmingDataLinkLayer: Use Hamming 1-bit error correcting codes on each frame. Correct any one bit errors and pass the corrected data to the network layer. A user should be able to specify the string "Hamming" at the command line to use this data link layer.

Note that all three layers should divide each message into smaller frames (unlike DumbDataLinkLayer). Be sure to modify NetworkLayer to send messages that are long enough such that at least three frames must be transmitted for a given message.


Submitting your work

From within your project directory, submit all of the Java source code, including those files copied from my public directory. That is, I want to be able to compile your code using the exact same files that you used. Submit like so:

cs29-submit project-1 *.java

This project has a revised deadline of 11:59 pm on Sunday, 17-October-2004.

Scott F. Kaplan
Last modified: Thu Oct 14 09:36:48 EDT 2004