In: Computer Science
If you have two machines belonging to David and Tom are connected by a perfect bidirectional channel (i.e., no corruption or loss of packets) for exchanging notes about Computer study. David and Tom designed the system to deliver data messages to each other’s machines in an alternating manner: First, David’s machine must deliver a message to Tom’s machine, then Tom’s must deliver a message to David’s, then David’s must deliver a message to Tom’s and so on. If a machine is in a state where it should not attempt to deliver a message to the other side, and there is an event like rdt_send(data) call from above that attempts to pass data down for transmission to the other side, this call from above can simply be ignored with a call to rdt_unable_to_send(data), which informs the higher layer that it is currently not able to send data. Draw a finite state machine (FSM) specification for this protocol, i.e., one FSM for David’s, and one FSM for Tom’s. You should use the following events and actions that have the same meaning as protocol rdt1.0: rdt_send(data), packet = make_pkt(data), udt_send(packet), rdt_rcv(packet), extract (packet, data), deliver_data(data). Make sure your protocol reflects the strict alternation of sending between the two machines. Also, make sure to indicate the initial states for David and Tom’s machines in your FSM descriptions
Hey! here is my answer...please give positive rating to appreciate my work.....
We have two machines belonging to David and Tom are connected by a perfect bidirectional channel (i.e., Reliable connection) for exchanging notes about Computer study.
David and Tom designed the system to deliver data messages to each other’s machines in an alternating manner: First, David’s machine must deliver a message to Tom’s machine, then Tom’s must deliver a message to David’s, then David’s must deliver a message to Tom’s and so on.
here the basic FSM for David and Tom
For building a Reliable Data Transfer of protocol over a
layer we firstly take the simple case of transferring data over a
completely reliable channel, the RDT 1.0 is a trivial
protocol.
This transfer of data is shown by using FSM (finite state machine)
which consist of FSM of sender and receiver separately.
In RDT 1.0 there is only one state each for sender and receiver,
here arrow indicates the transition of protocol from one state to
another.
Sending Side:
RDT is simple it takes the data from the above layer in the for
of segments it remove the segment header and make the data in the
form of packet using make_pkt and sends the packet into the channel
using udt_send (unreliable data transfer).
Receiving Side
RDT receives a packet from the underlying channel via the
rdt_rcv (packet) removes the data from the packet using extract
(packet, data) and passes the data up to the upper-layer. The
rdt_rcv (packet) event result from a procedure call i.e. from
rdt_rcv() packet from the lower layer of the
protocol.
IN FSM Specification
Sender:
If the upper layer is called, the rdt_send event is generated, the packet activity is created and the check box is added, and udt_send() on the channel is called to send the packet. At the same time, it enters the waiting ACK/NAK state. If it is NAK, it retransmits the packet and continues to wait for ACK/NAK. It remains in this state until it returns the ACK and enters the waiting for calling state
.
Receiver:
When a packet is passed in, rdt_rcv receives and judges. If
there is no error extract extraction, it is delivered to the upper
deliver_data and returns ACK. If an error occurs, it directly
returns NAK and is waiting for receiving.
Initial state of bos David and tom FSM is waiting... they wait for call from upper layer at sender side and at Reciving side Waiting for call from lower layer...
thanks...........for any query please ask me in comment box...