Assignment3

advertisement
Assignment3: Transport Layer -> Reliable Data Transfer
CS390 Data Networking
YOU MAY WORK WITH A PARTNER // GO-BACK-N IS EXTRA CREDIT
In this assignment you and your partner will explore the stop and wait, go back N,
and selective repeat reliable data transfer protocols. For each protocol create a
sender which breaks up a 10M file into 1K segments and sends the segments to the
receiver. Each time a segment is sent the probability that a segment will:
- arrive okay 70%
- not arrive (use a timeout) 10%
- be corrupted (use a random bit error) 10%
- arrive out of order (use a sequence number) 10%
at the receiver.
After the receiver has received to segment the receiver will send a response
(ack/nack ). Each time the ack/nack is sent to probability that the ack/nack will:
arrive okay 70%
- not arrive (use a timeout) 10%
- be corrupted ( use a random bit error) 10%
- arrive out of order (use a sequence number) 10%
For each protocol, write a sender and receiver that handles reliable data transfer. If
you are working with a partner, you and your partner should divide the work up so
that one partner writes the sender and the other partner writes the receiver.
You should accurately simulate unreliable data transfer. To simulate a segment
that does not arrive at the receiver, you should not send the segment receiver and
have the absence of an ack from the receiver trigger a timeout. To simulate a
corrupted segment you should generate a random bit error in the segment and
have the receiver detect the bit error through a checksum. To simulate a segment
which arrives out of order you should include a sequence number in each segment
and transmit a segment with the wrong sequence number two receiver.
Provide feedback in your program for the protocol. For no error, have the
sender/receiver print out the action that was taken when a segment/ack is
send/received. Have the sender/receiver print out the TYPE of unreliable data
transfer detected, then print out the action taken to deal with the unreliable data
transfer. For example (stop and wait):
Receiver:
Receiver:
Receiver:
resending
segment corrupted, bad checksum, sending nack
segment 42 received, sending ack42
segment 42 received, duplicate segment, ignoring,
ack42
Download