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.
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:
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.
You must create three new data link layers that are subclasses of the abstract DataLinkLayer class:
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.
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