Mini Project Networking
Mini Project Networking
This is to certify that the work presented in the project entitled “Implement
sliding window protocol” in partial fulfillment of the requirement for the award
of degree of Bachelor of Computer Application of INSTITUTE OF ENGINEERING &
MANAGEMENT is an authentic work carried out under my supervision and
guidance.
To the best of my knowledge the content of this project does not form a
basis for the award of any previous Degree to anyone else.
Date:
_______________________
Guide’s Name
Dept. of Computer Application
Institute of Engineering & Management
1
Acknowledgements
We would like to express our special thanks of gratitude to our Guide (Assistant
Prof Manjima Saha) who helped us a lot in this project, her valuable suggestions
helped us to solve tough challenges and without her help this project could not
have been completed in time. A special thanks to our Head of Department (Prof
Abhishek Bhattacharya) who gave us the golden opportunity to do this wonderful
project on the topic (Implement Slide Window Protocol), which also helped us in
doing a lot of research and we came to know about so many new things we are
really thankful to them. Secondly we would like to thank our friends who helped
us a lot in finalizing this project within the limited time frame.
2
Contents
Chapter 1
1.1 Introduction………………………………………………………………………… ……… 4
Chapter 2
2.1 Scope of the project……………………………………………………………………….5
Chapter 3
3.1 Block diagram/work flow diagram ………………………………………………..9
Chapter 4
4.1 Requirement Analysis…………………………………………………………………..11
Chapter 5
5.1 Results and
conclusion………………………………………………………………….12
3
Chapter 1
1.1 Introduction
4
Chapter 2
For efficient data packet transmission, the transmitter must not be forced to
stop sending for an unnecessarily long time. This will happen if the
receiving computer sends an acknowledgment signal to stop and does not
send another signal to begin transmitting when its buffer has available
space or is empty. Other considerations for efficient data packet
transmission include:
Round-trip delay time
End-to-end delay
Bandwidth delay
Both sender and receiver agrees on some window size. If window size=w
then after sending w frames sender waits for the acknowledgement (ack) of
the first frame.
5
As soon as sender receives the acknowledgement of a frame it is replaced by
the next frames to be transmitted by the sender. If receiver sends a
collective or cumulative acknowledgement to sender then it understands
that more than one frames are properly received, for eg:- if ack of frame 3
is received it understands that frame 1 and frame 2 are received properly.
In sliding window protocol the receiver has to have some memory to compensate any
loss in transmission or if the frames are received unordered.
tx = Transmission time
tp = Propagation delay
Sliding window works in full duplex mode
#include<stdio.h>
int main()
{
6
int w,i,f,frames[50];
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
Enter 5 frames : 12 5 89 4 6
7
With sliding window protocol the frames will be sent in the
following manner (assuming no corruption of frames)
After sending 3 frames at each stage sender waits for
acknowledgement sent by the receiver
12 5 89
Acknowledgement of above frames sent is received by sender
46
Acknowledgement of above frames sent is received by sender
8
Chapter 3
9
Go-Back-N ARQ is a specific instance of the automatic repeat request (ARQ) protocol,
in which the sending process continues to send a number of frames specified by
a window size even without receiving an acknowledgement (ACK) packet from the
receiver. It is a special case of the general sliding window protocol with the transmit
window size of N and receive window size of 1. It can transmit N frames to the peer
before requiring an ACK.
Selective Repeat is part of the automatic repeat-request (ARQ). With selective repeat,
the sender sends a number of frames specified by a window size even without the need
to wait for individual ACK from the receiver as in Go-Back-N ARQ. The receiver may
selectively reject a single frame, which may be retransmitted alone; this contrasts with
other forms of ARQ, which must send every frame from that point again. The receiver
accepts out-of-order frames and buffers them. The sender individually retransmits
frames that have timed out.
Chapter 4
10
4.1 Requirement Analysis
For any sliding window protocol to work without any problem, the following condition must
be required and satisfied-
Available Sequence Numbers >= Sender Window Size + Receiver Window Size
Thus,
Minimum number of sequence numbers required = Sender Window Size + Receiver
Window Size.
Stop and Wait ARQ is a one bit sliding window protocol where-
Sender window size = 1
(Number of unacknowledged data packets at sender side at any time can be at most 1)
Receiver window size = 1
(Number of unacknowledged data packets at receiver side at any time can be at most 1)
Thus,
Sender window size + Receiver window size
=1+1
=2
By above condition,
Available sequence numbers >= 2
Thus,
Minimum number of sequence numbers required in Stop and Wait ARQ = 2.
The two sequence numbers used are 0 and 1.
Chapter 5
11
5.1 Results &conclusions
12