Lab 4 (18.3.) - Link Layer Protocol Programming
In this lab we will play with the parameters and do some coding to improve a link layer protocol. The protocol can be downloaded here.
The simulation consists of four classes
The Simulation.java simulates the communication between two Link Layers, which each use their own Physical Layer to actually exchange messages.
One of the Link layers acts as sender, the other as receiver of a String sent in packages of 1 Byte. Each package is individually acknowledged, only after acknowledgment the next package is transmitted.
Messages can get garbled, therefore the Link Layers use a parity bit to check for errors. If a parity is wrong, no acknowledgement is sent. The sender will then receive a timeout and retransmit the package.
Your tasks are
- Understand the code
- Explain why much less than errorProb frames are retransmitted
- Find the optimal value for the retransmission timer
- Improve the protocol by transmitting more than one package (aka sliding window)
- Improve the protocol by introducing negative acknowledgements, that is, if the receiver notices that a message got corrupted, he notifies the sender instead of just waiting until the sender retransmit after a timeout. How big is the improvement due to NACKs? Under which circumstances would it be bigger/smaller?
- Bonus: Improve the error correction of the protocol, and measure how many messages you save compared with by how much you increase the message length.