CS 633
Out
Date :
In
date :
Lab 2: Stop and Wait
Data Link Protocol
Object : To implement a stop and wait datalink protocol
Procedure :
A.
Data Structures :
data_msg_t : Includes sender id, receiver id,
length of data , type, data and parity fields
cont_msg_t : Includes sender id, receiver
id, type and parity fields
fsm_mat_t : Has pointers to functions
B. Sender FSM
B.1. Provide a FSM for the sender and fill in the
required function pointers in this FSM
B.2. The Sender is implemented as a
Solaris thread
B.3. The Sender waits on the send_sem semaphore (initialized to 0) and writes to the data_msg global area
It has to be signalled so that it can
perform the next action. It reads from the cont_msg
and goes to the necessary action determined by the type of the control message
and its current state.
C.
Application Thread
C.1. Application thread reads from a file, puts the message
in a data_msg and signals the sender
C.2. After each Xmit_request, the
Application waits on its semaphore (app_sem) to be signaled
by the Sender.
D . Receiver FSM
C.1. Provide a FSM
for the receiver and fill in the required function pointers in this FSM
C.2. The Receiver is implemented as a Solaris thread
C.3. The Receiver waits on the recv_sem semaphore
(initialized to 0) and reads from the data_msg global
area
It prepares and writes the cont_msg and signals the sender.
D. Test :
D.1. . The Application Layer
(A thread) reads 20 bytes from the file sample.htm
(in the homepage, convert it to text file first) and puts a message to the cont_msg and
signals the sender.
D.2. The Sender reads the Application
command, transfers the data to a data_msg, writes it
at the data_msg location. It then signals the
Receiver.
D.3. The Receiver reads and
sends a reply and also prints the message data to the screen (the higher layer)
D.4. Note
that the Sender should signal the Application unlike in a real environement.
We
should see the file contents on the screen as before. Extra points (20) for time out
implementation
Send
your files by e-mail to kerciyes@csusm.edu
for this assignment only