Open In App

Noiseless Channel Protocol

Introduction :
A protocol is a set of rules used by two devices to communicate. These sets of rules are usually decided by headers (fixed headers determined by the protocol). These headers specify the content of the message and the way this message is processed. To detect the error, the header must be the address of the destination, the address of the source, the checksum of the message.

Categorization of protocol :
The exploration of protocols is split into those that can be applied for noiseless(error-free) channels and those that can be used for noisy(error-causing) channels. The first category of protocols cannot be used in actual life, but they serve as a basis for protocols for noise channels.



Noiseless Channel :
An idealistic channel in which no frames are lost, corrupted or duplicated. The protocol does not implement error control in this category. There are two protocols for the noiseless channel as follows.



Simplest Protocol – 
We consider here that the receiver can maintain any frame received with insignificant processing time. The receiver’s data link layer immediately removes the header from the frame and assigns the data packet to its network layer, which can also accept the packet immediately. That is to say, the receiver can never be overwhelmed with forthcoming frames.

Design of Simplest Protocol with no error control or flow

while(true)                     //Repeat forever
{ 
   waitForEvent();              //sleep until an event occur
   if (Event(RequestToSend))    //there is a packet to send
   {
         GetData();
         MakeFrame();
         SendFrame();            //send the frame
    }
}
while(true)                           //Repeat forever
{ 
   waitForEvent();                    //sleep until an event occur
   if (Event(ArrivalNotification))    //data frame arrived
   {
         ReceiveFrame();
         ExtractData();
         DeliverData();               //Deliver data to network layer
    }
}

Flow Diagram for Simplest Protocol

Stop and Wait Protocol – 
If data frame receivers arrive at the site faster than they can be processed, then frames must be stored until their use. Generally, the receiver does not have enough storage space, especially if it is receiving data from multiple sources.

Design of Stop-and-Wait Protocol

while(true)                                //Repeat forever
canSend = true                             // Allow the first frame to go
{ 
   waitForEvent();                         //sleep until an event occur
   if (Event(RequestToSend)AND canSend)    //there is a packet to send
   {
         GetData();
         MakeFrame();
         SendFrame();                      //send the data frame
         canSend = false;                  //cannot send until ACK arrives
    }
    WaitForEvent();                        //sleep until an event occurs
    if(Event(ArrivalNotification))         //An ACK has arrived
    {
        ReceiveFrame();                    //Receive the ACK frame
        CanSend = true;
}      
while(true)                                //Repeat forever

{ 
   waitForEvent();                         //sleep until an event occur
   if (Event(ArrivalNotification)          //data frame arrives
   {
         ReceiveFrame();
         ExtractData();
         DeliverData();               //Deliver data to network layer
         SendFrame();                 //Send an ACK frame
    }
 }

Flow diagram for Stop & Wait Protocol

Article Tags :