Develop a simple data link layer that performs the flow control using the sliding window protocol, and loss recovery using the Go-Back-N mechanism.

 Develop a simple data link layer that performs the flow control using the sliding window protocol, and loss recovery using the Go-Back-N mechanism.

Hardware Requirements: Intel based Desktop PC:RAM of 1GB

Software Requirement: Turbo C / Turbo C++

Theory:

Sliding Window:

Sliding window is a technique for controlling transmitted data frames between two network computers where reliable and sequential delivery of data frames is  required, such as when using the Data Link Layer (OSI model) or Transmission Control Protocol (TCP).In the sliding window technique, each data frame (for most data link layers) and byte (in TCP) include a unique consecutive sequence number, which is used by the receiving computer to place data in the correct order. data corruption occurred in transit.The objective of the sliding window technique is to use the sequence numbers to avoid duplicate data and to request missing data.Sliding window is also known as windowing.




Go-Back-N ARQ:

Stop and wait ARQ mechanism does not utilize the resources at their best.When the acknowledgement is received, the sender sits idle and does nothing.  In Go-Back-N ARQ method, both sender and receiver maintain a window.The sending-window size enables the sender to send multiple frames without receiving the acknowledgement of the previous ones. The receiving-window enables the receiver to receive multiple frames and acknowledge them. The receiver keeps track of incoming frame’s sequence number.When the sender sends all the frames in window, it checks up to what sequence number it has received positive acknowledgement.If all frames are positively acknowledged, the sender sends next set of frames. If sender finds that it has received NACK or has not receive any ACK for a particular frame, it retransmits all the frames after which it does not receive any positive ACK.

SOURCE CODE:

#include<stdio.h>

int main()

{

    int w,i,f,frames[50];

    printf("Enter window size: ");

    scanf("%d",&w);

    printf("\nEnter number of frames to transmit: ");

    scanf("%d",&f);

    printf("\nEnter %d frames: ",f);

    for(i=1;i<=f;i++)

     scanf("%d",&frames[i]);

 

  printf("\nWith sliding window protocol the frames will be sent in the following manner (assuming no corruption of frames)\n\n");

 printf("After sending %d frames at each stage sender waits for acknowledgement sent by the receiver\n\n",w);

  for(i=1;i<=f;i++)

    {

        if(i%w==0)

        {

           printf("%d\n",frames[i]);

           printf("Acknowledgement of above frames sent is received by sender\n\n");

        }

        else

           printf("%d ",frames[i]);

    }

    if(f%w!=0)

        printf("\nAcknowledgement of above frames sent is received by sender\n");

    return 0;

}

OUTPUT CONSOLE:






Comments

  1. Documents a properly reviewed saying great with this range impregnable placement appropriately with your can be totally an potential on its own. Wonderful meaning. You typically lavish awesome. This really is lastly pattern My business is exposition numerous within your website in addition way acquiring that inspirational personal. IR Repeater

    ReplyDelete
  2. Whether you're new to paid advertising or a pay-per-click (PPC) veteran, Google's smart campaigns can be your best friend. The rapid advancements in artificial intelligence technology at the heart of Google Ads make PPC marketing an entirely different beast, one that may be easier to tame in 2020.
    https://ppcexpo.com/blog/smart-campaigns

    ReplyDelete

Post a Comment

Search related post on google