Skip to content
Related Articles
Open in App
Not now

Related Articles

Utopian Simplex Protocol in Computer Network

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 31 Jul, 2022
Improve Article
Save Article

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 –

  • Fetch a packet from the network layer,
  • Construct an outbound frame using the variable s,
  • Send the frame on its way.

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:

  • The design of Utopian Simplex Protocol is based on 2 procedures i.e. Sender and Receiver.
  • Both Sender and Receiver run in the data link layer but the sender runs in the data link layer of the source machine while Receiver runs in datalink layer of the destination machine.
  • It is designed for Uni-directional data transmission.
  • Sender and receiver are always ready for data processing.
  • Both of them have infinite buffer space available.
  • The communication links never losses any data frames.
  • It is considered as unrealistic as it does not handle flow control or error correction.
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!