In: Computer Science
Consider a scenario where Host A and Host B want to send
messages to Host C. Hosts A and C are connected by a channel that
can lose and corrupt (but not reorder) messages. Hosts B and C are
connected by another channel (independent of the channel connecting
A and C) with the same properties. The transport layer at Host C
should alternately deliver M (M>1) consecutive messages received
from A to its application layer and N (N>1) consecutive messages
received from B to its application layer, i.e., M messages from A,
N messages from B, M messages from A, N messages from B, and so
on.
Design a NAK-free stop-and-wait protocol to achieve reliable data
transfer from A and B to C, by giving FSM descriptions of the
protocols at A and C. (The FSM for B is essentially the same as
that for A except the number of messages, and hence you do not need
to provide B’s FSM.) Notes: (1) If you use variables and procedure
calls other than those defined in Chapter 3.4 of the textbook,
clearly describe their functions. (2) You can use the following
mechanisms: checksum, sequence numbers (you need a larger sequence
number range than just 0 and 1), ACKs (but not NAKs), timer and
sender retransmission. (3) Recall we do not consider buffering of
received packets in a stop-and-wait RDT protocol.
Stop-and-wait like error-control protocol:
Flow of the Sender FSM:
The data in the sender FSM (Finite state machine) changes the states as follows:
Initialize the session and the sequence number should be started with 0.
Build the packet with the sequence number and data .
Start the timer and broadcast the packet with hosts in the channel.
Wait for the acknowledgement.
If acknowledgement is not received within sepecified time, then broadcast the packet to all the hosts in the channel.
Flow of the Receivers FSM:
The acknowledgement in the receiver FSM (Finite state machine) changes the states as follows: