Professional Documents
Culture Documents
Prepared by:
Srinandan A B Siddhant Singh Sri Hari K R Suhas M Suyog P
Shubham Sahu Sowmya A R Suchitra S Sunidhi A G T
Rachana
The data link layer can combine framing, flow control, and error control to
achieve the delivery of data from one node to another, these are done by
certain protocols
They are:
For noiseless channel: 1) Simplest protocol
2)Stop and wait
For noisy channel: 1)Stop and wait
2)Go-back N
3)Selective Repeat
The protocols we discuss here and those used in real life are different, as we
discuss protocols are unidirectional (data frames travel one node called sender
to another node called receiver). But in real life, data link protocols are
implemented as bidirectional (data flows in both directions).
•Simplest Protocol is one that has no flow or error control and
it is a unidirectional protocol in which data frames are
travelling in only one direction-from the sender to receiver.
• The sender site cannot send a frame until its network layer has a data packet to
send. The receiver site cannot deliver a data packet to its network layer until a
frame arrives.
SENDER SIDE ALGORITHM
int main()
{
int w,i,f,frames[50];
for(i=1;i<=f;i++)
cin>>frames[i];
cout<<"\nWith sliding window protocol the frames will be sent in the following manner (assuming no corruption of frames)\n\n";
cout<<"After sending "<<w<<" frames at each stage sender waits for acknowledgement sent by the receiver\n\n";
for(i=1;i<=f;i++)
{
if(i%w==0){
cout<<frames[i]<<"\n";
cout<<"Acknowledgement of above frames sent is received by sender\n\n";
}
else
cout<<frames[i]<<" ";
}
if(f%w!=0)
cout<<"\nAcknowledgement of above frames sent is received by sender\n";
return 0;
}
SELECTIVE REPEAT PROTOCOL:
DEFINITION:
Selective Repeat protocol is a specific instance of the automatic repeat
request protocol (ARQ) used to solve sequence number dilemma in communications.
Here the sender sends a number of frames specified by a window size even without the
need to wait for individual acknowledgement (ACK) from the receiver as in Go-Back-N
protocol.
Selective Repeat Protocol Program in C:
#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;
}
Go back N is more often used than other protocols.
SR protocol is less used because of its complexity.
Stop and Wait ARQ is less used because of its low efficiency.
Depending on the context and resources availability, Go back
N or Selective Repeat is employed.
Selective Repeat and Stop and Wait ARQ are similar in terms
of retransmissions.
Go back N and Selective Repeat are similar in terms of
efficiency if sender window sizes are same.
SR protocol may be considered as a combination of
advantages of Stop and Wait ARQ and Go back N.
SR protocol is superior to other protocols but because of its
complexity, it is less used.
TECHNOLOGIES THAT USE FLOW
CONTROL
Software flow control
Computer networking
Traffic contract
Congestion control
Teletraffic engineering in broadband networks
Teletraffic engineering
Ethernet flow control
Atm