Open In App

Utopian Simplex Protocol in Computer Network

We will consider a protocol that is simply because it does not worry about the possibility of anything going wrong. Data are transmitted in one direction only. Both transmitting and receiving network layers are always ready. Processing time can be ignored. Infinite buffer space is available. This thoroughly unrealistic protocol, which we will nickname “Utopia”, is simply to show the basic structure on which we will build. Its implementation is shown below.

Utopian simplex Protocol: There is one direction of data transmission only from sender to receiver. Here we assume the communication channel to be error-free and the receiver will infinitely quickly process the input. The sender pumps out the data onto the line as fast as it can.



typedef enum {frame_arrival} event_type;

#include"protocol.h"

void sender1(void)
{
 frame s;                     /* buffer for an outbound frame */
 packet buffer;                /* buffer for an outbound packet */
 while(true)
 {
  from_network_layer(&buffer);   /* go get something to send */
  s.info=buffer;               /* copy it into s for transmission */
  to_physical_layer(&s);        /* send it on its way */
 }                           
}

void receiver1(void)
{
 frame r;
 event_type event;             /* filled in by wait, but not used here */
 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 */
  }
}

This protocol has two different procedures, a sender and a receiver. MAX_SEQ is not needed because no sequence numbers or acknowledgements are used. The only event type possible is frame_arrival (i.e. the arrival of an undamaged frame). The sender pumps out the data in an infinite while loop as fast as it can. The loop body consists of three actions and they are –

Other fields have to do with error and flow control and there are no errors or flow control restrictions here so only the info field is used here. The receiver is equally simple. The procedure wait_for_event returns when the frame arrives and the event is set to frame_arrival. The newly arrived frame from the hardware buffer is removed by the call from_physical_layer and put in the variable r, so that receiver can get it. The data link layer settles back to wait for the next frame when the data portion is passed on to the network layer, suspending itself until the frame arrives. It does not handle either flow control or error correction therefore it is unrealistic.



Properties of Utopian Simplex Protocol:

Article Tags :