Computer and Hardware Resources
English  English   French  French   German German Portuguese Portuguese   Spanish Spanish   Russian Russian
Stop and wait Protocol

Submit your Website

Home > Data Communications > Stop and wait Protocol

 

Stop and Wait Protocol

Protocols in which the sender sends on frame and then waits for an acknowledgement before proceeding are called stop-and-wait protocols. The following code gives the example of a simplex stop-and-wait protocols.

Protocols 2 (stop-and-wait) also provides for a one-directional flow of data from sender to receiver. The communication channel is once again assumed to be error free, as in protocol 1. However, this time, the receiver has only a finite buffer capacity and a finite processing speed, so the protocol must explicitly prevent the sender from flooding the receiver with data faster than it can be handled.

typedef enum (frame arrival) event type :
#include “protocol.h”
void sender 2(void)
{
frame s; /*buffer for an outbound frame*/
packet buffer; /* buffer for an outbound frame*/
event_type event; /* frame arrival is the only possibility*/
while (true) {
from_network_layer (&buffer); /* go get something to send*/
s.info=buffer; /* copy it into s for transmission*/
to_physical layer (&s) /* bye little frame*/
wait_for_event (&event); /* do not proceed until given the go ahead*/
}
}
void receiver 2 (void)
{
frame r, s; /* buffers for frame*/
event_type event; /* frame_arrival is the only possibility*/
while (true) {
wait_for_event (&event); /* only possibility is frame_arrival*/
from_physical_layer (&r) /* go get the inbound frame */
to_network_layer(&r.info); /* pass the data to the network layer*/
to_physical_layer (&s) /* send a dummy frame to awakers sender*/

Here the sender starts out by fetching a packet from the network layer, using it to construct a frame and sending it on its way. Only now, the sender must wait until an acknowledgement frame arrives before looping back and fetching the next packet from the network layer. The sending data link layer need not even inspect the incoming frame : there is only one possibility.

After delivering a packet to the network layer, receiver 2 sends an acknowledgement frame back to the sender before entering the wait loop again. Because only the arrival of the frame back at the sender is important, not its contents, the receiver need not put any particular information in it.

More Information
Pulse Code Modulations
Windows Protocol
Frequency Division Multiplexing
Data Transmission Impairments
Error Correction Methods
Error Detection Methods
Basic Transfer of Data
Simplex, Full & Half Duplex
Asynchronous Data Transmission
Electromagnetic Waves
Fibre Optic
Serial, Parallel & Synchronous Data Transmission
VSAT Communications
Satellite Communication
Transmission Lines
Data Formats
Multimedia Software
Desktop Enhancement
Web Designing Services
Flash Memory

Related Information
Data Recovery UK
RAID Recovery
Mortgages
Project Management
Ediscovery

Submit your Website

Pulse Code Modulation | Fibre Optic Communication