Assignment Paper

For all state diagrams the following descriptions apply: States are represented by circles. Line segments with
terminating arrow points represent transitions. Associated with transitions are events and actions. Events are
indicated above the dotted line and actions are indicated below the dotted line. It should be recognized that all
transitions are initiated by events. For a transition there need not be an action.
We now consider a small change to the new and improved transmit state machine as depicted in the figure to
be used for the homework assignment. This state machine has almost the same 4 unique states. In the upper
left corner of the figure is a state labeled “Wait for Call 0 from above” In the upper right corner of the figure is a
state now labeled “Wait for ACK 0”. In the bottom right corner of the figure is a state labeled “Wait for Call 1
from above”. In the bottom left corner of the figure is a state now labeled “Wait for ACK 1”.
At initialization time the machine is set at state “Wait for Call 0 from above”. A new event has been added to
the events which cause transitions from this state. The new event is that of the reception of a packet. While inthis state any packets received are simply thrown away as no action is performed.
The state of “Wait for Call 0 from above” is re-entered. The event which transitions from the upper left to the
state in the upper right is that of an indication that the process “underscore_R_D_T_send” has data to send.
The actions performed with the recognition of this event is that of computation of a checksum over the data, the
encapsulation of the data and checksum and an indication that an ACK0 is to be sent when this packet is
received are placed a packet.
Finally the transfer of that packet over the transmission media is performed. A timer is started. With the
completion of these actions the state “Wait for ACK 0” is entered.
While in this state three possible event scenarios can occur. One of them is the reception of an ACK 1 or a
corrupt packet. The action for this event is to resend the packet for which a response is being waited on and
the state “Wait for ACK 0” is re-entered. Another possible scenario it that the response timer times out. The
action is to resend the packet. The final possible event scenario is the reception of a packet which is not
corrupted and contains an ACK 0 indication. The action associated with this event is to stop the response
timer, a transition is made to the state in the lower right corner of the figure labeled “Wait for call 1 from above”.
In order to transition from this state a transmission event is signaled when the process
“underscore_R_D_T_send” executes indicating a new stream of data to be sent. The actions performed with
the recognition of this event is that of computation of a checksum over the data, the encapsulation of the data
and checksum and an indication that an ACK1 is to be sent when this packet is received are placed a packet.
Finally the transfer of that packet over the transmission media is performed and the response timer is started.
With the completion of these actions the state labeled “Wait for ACK 1” in the lower left corner of the figure is
entered. While in this state three possible event scenarios can occur. One of them is the reception of an ACK 0
or a corrupt packet. The action for this event is to resend the packet for which a response is being waited on
and the state “Wait for ACK 1” is re-entered. Another possible event is the response timer timing out. The
action is to resend the packet and restart the timer. The final scenario is the reception of a packet which is not
corrupted and contains an ACK 1 indication. The action associated with this event is to stop the response
timer.
A transition then is made to the state in the upper left corner of the figure labeled “Wait for call 0 from above”.
At this point the state machine is in its initial state and the entire process can repeat. Note that the state
machine on the receiving side does not change from its previous implementation.
Create a state machine of the receiving side which communicates with the above sending side state machine
and implement it as a program.