From CS 455 Spring 2013

CS455-S13: Program 4: Alternating Bit Reliable Transport

Assigned: Tuesday, April 9, 2013
Due: Tuesday, April 23, 2013 before 11:59pm

Contents (hide)

Description

The goal of this assignment is to implement an alternating bit reliable transport protocol over UDP. This is based off of the RDT 3.0 reliable transport protocol from Chapter 3. You will implement both a sender and a receiver.

Sender

SENT: message that was sent
RECV: message that was received OR timeout!
blank line

Receiver

RECV: message that was received
SENT: message that was sent - delayed xx ms OR nothing!
blank line

Rules

Testing

A large part of your program's grade will be determined by how well it handles a set of inputs. You should test your program rigorously before submitting. Because your programs will be run and tested using a script, you must format your output exactly as I have described or you will lose points.

In all of these examples, the packets dropped and the amount of delays should be exactly as in this example since a seed was specified on the command-line. Note that I'm provided separate examples for Java and Python since the same seed produces different results.

Example Set 1 - usage statements

java AbrtReceiver
Usage: java AbrtReceiver port delay lossRate [seed]
         port - listening port (10001-11000)
         delay - avg delay (ms)
         lossRate - loss percentage [0-1]
         seed - RNG seed (optional)
java AbrtSender 
Usage: java AbrtSender host port msgs
         host - receiver hostname
         port - receiver port (10001-11000)
         msgs - number of unique messages to send
python AbrtReceiver.py
Usage: python AbrtReceiver.py port delay lossRate [seed]
         port - listening port (10001-11000)
         delay - avg delay (ms)
         lossRate - loss percentage [0-1]
         seed - RNG seed (optional)
python AbrtSender.py
Usage: python AbrtSender.py host port msgs
         host - receiver hostname
         port - receiver port
         msgs - number of unique messages to send

Example 2

java AbrtReceiver 10005 4 40
ERR - arg 3

Example 3 - Java only

atria> java AbrtReceiver 10005 500 0.1 7777
RECV: 0 0 4
SENT: ACK 0 - delayed 425 ms

RECV: 1 1 4
SENT: nothing!

RECV: 1 1 4
SENT: ACK 1 - delayed 577 ms

RECV: 0 2 4
SENT: ACK 0 - delayed 701 ms

RECV: 1 3 4
SENT: ACK 1 - delayed 872 ms

sirus> java AbrtSender atria 10005 4
SENT: 0 0 4
RECV: ACK 0

SENT: 1 1 4
RECV: timeout!

SENT: 1 1 4
RECV: ACK 1

SENT: 0 2 4
RECV: ACK 0

SENT: 1 3 4
RECV: ACK 1

Example 4 - Java only

atria> java AbrtReceiver 10005 150 0.2 7890
RECV: 0 0 4
SENT: nothing!

RECV: 0 0 4
SENT: nothing!

RECV: 0 0 4
SENT: ACK 0 - delayed 197 ms

RECV: 1 1 4
SENT: ACK 1 - delayed 131 ms

RECV: 0 2 4
SENT: nothing!

RECV: 0 2 4
SENT: ACK 0 - delayed 270 ms

RECV: 1 3 4
SENT: ACK 1 - delayed 145 ms

sirius> java AbrtSender atria 10005 4
SENT: 0 0 4
RECV: timeout!

SENT: 0 0 4
RECV: timeout!

SENT: 0 0 4
RECV: ACK 0

SENT: 1 1 4
RECV: ACK 1

SENT: 0 2 4
RECV: timeout!

SENT: 0 2 4
RECV: ACK 0

SENT: 1 3 4
RECV: ACK 1

Example 5 - Python only

atria> python AbrtReceiver.py 10005 500 0.1 1234
RECV: 0 0 4
SENT: ACK 0 - delayed 440 ms

RECV: 1 1 4
SENT: nothing!

RECV: 1 1 4
SENT: ACK 1 - delayed 939 ms

RECV: 0 2 4
SENT: ACK 0 - delayed 671 ms

RECV: 1 3 4
SENT: ACK 1 - delayed 83 ms

sirus> python AbrtSender.py atria 10005 4
SENT: 0 0 4 
RECV: ACK 0

SENT: 1 1 4 
RECV: timeout!

SENT: 1 1 4 
RECV: ACK 1

SENT: 0 2 4 
RECV: ACK 0

SENT: 1 3 4 
RECV: ACK 1

Example 6 - Python only

python AbrtReceiver.py 10005 150 0.5 5679
RECV: 0 0 4
SENT: nothing!

RECV: 0 0 4
SENT: ACK 0 - delayed 137 ms

RECV: 1 1 4
SENT: ACK 1 - delayed 194 ms

RECV: 0 2 4
SENT: nothing!

RECV: 0 2 4
SENT: ACK 0 - delayed 15 ms

RECV: 1 3 4
SENT: ACK 1 - delayed 206 ms

python AbrtSender.py atria 10005 4
SENT: 0 0 4 
RECV: timeout!

SENT: 0 0 4 
RECV: ACK 0

SENT: 1 1 4 
RECV: ACK 1

SENT: 0 2 4 
RECV: timeout!

SENT: 0 2 4 
RECV: ACK 0

SENT: 1 3 4 
RECV: ACK 1

Example 7

I'm not giving the results here, but try this:

atria> java AbrtReceiver 10005 660 0.4 5678
sirius> java AbrtSender atria 10005 4

It should produce two premature timeouts in a row (on data 1 and the retransmission of data 1) by delaying the ACKs by 1015ms and 1285ms. Convince yourself that the operation of your program is correct.

I haven't found a similar case for Python yet. If I do, I'll post it here.

Submission

You must name your source files AbrtSender.java and AbrtReceiver.java or AbrtSender.py and AbrtReceiver.py (note the capitalization). Make sure that you submit all files necessary to compile your program. But, do not submit compiled files (.class files).

Directions for submitting your assignment through Blackboard

Retrieved from http://www.cs.odu.edu/~mweigle/CS455-S13/Prog4
Page last modified on April 09, 2013, at 10:57 AM