Skip to content
Related Articles

Related Articles

Noiseless Channel Protocol
  • Difficulty Level : Medium
  • Last Updated : 22 Mar, 2021

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 :
    The data link layer at the sender site gets data from its network layer, makes a frame out of the data, and sends it. The data link layer(receiver site) receives a frame from its physical layer, extracts data from the frame, and convey the data to its network layer. The data link layers of the sender and receiver provide communication/transmission services for their network layers. The data link layers utilization the services provided by their physical layers for the physical transmission of bits.

Design of Simplest Protocol with no error control or flow

  • Sender-site and Receivers algorithms :
    Sender-site algorithm –
while(true)                     //Repeat forever
{ 
   waitForEvent();              //sleep untill an event occur
   if (Event(RequestToSend))    //there is a packet to send
   {
         GetData();
         MakeFrame();
         SendFrame();            //send the frame
    }
}
  • Receivers algorithm –
while(true)                           //Repeat forever
{ 
   waitForEvent();                    //sleep untill an event occur
   if (Event(ArrivalNotification))    //data frame arrived
   {
         ReceiveFrame();
         ExtractData();
         DeliverData();               //Deliver data to network layer
    }
}
  • Flow Diagram :
    This Flow Diagram shows an example of communication using the simplest protocol. It is very straightforward. The sender sends a series of frames without further consideration about the receiver. Let’s take an example, three frames will send from the sender, and three frames received by receivers. Bear in mind the data frames are shown by tilted boxes; the height of the box defines the transmission time difference between the first bit and the last bit in the frame.
  • Diagram

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 :
    On Comparing the stop-and-wait protocol design model with the Simplest protocol design model, we can see the traffic on the front/forward channel (from sender to receiver) and the back/reverse channel. Anytime, there is either one data frame on the forward channel or one ACK frame on the reverse channel. We hereupon require a half-duplex link.

Design of Stop-and-Wait Protocol

  • Sender-site and Receivers algorithms :
    Sender-site algorithm –
while(true)                                //Repeat forever
canSend = true                             // Allow the first frame to go
{ 
   waitForEvent();                         //sleep untill 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 untill ACK arrives
    }
    WaitForEvent();                        //sleep untill an event occurs
    if(Event(ArrivalNotification))         //An ACK has arrived
    {
        RecieveFrame();                    //Recieve the ACK frame
        CanSend = true;
}      
  • Receivers algorithm –
while(true)                                //Repeat forever

{ 
   waitForEvent();                         //sleep untill an event occur
   if (Event(ArrivalNotification)          //data frame arrives
   {
         ReceiveFrame();
         ExtractData();
         DeliverData();               //Deliver data to network layer
         SendFrame();                 //Send an ACK frame
    }
 }
  • Flow Diagram : 
    This figure shows an example of communication using the Stop-and-wait protocol. It is still straightforward. The sender sends a frame and waits for a response from the receiver. When ACK(acknowledged) will arrival from the receiver side then send the next frame and so on. Keep it in mind when two frames will be there sender will involve in four event and the receivers will involve in two events.

Flow diagram for Stop & Wait Protocol

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :