0% found this document useful (0 votes)
89 views13 pages

Mini Project Networking

The document describes a project report on implementing a sliding window protocol. It includes the names and student details of six students, a declaration from their guide, and acknowledgements. The report will cover the scope of the project including how sliding window protocols work, implementing one in C code, and analyzing the requirements for sequence numbers.

Uploaded by

Arindam Guin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views13 pages

Mini Project Networking

The document describes a project report on implementing a sliding window protocol. It includes the names and student details of six students, a declaration from their guide, and acknowledgements. The report will cover the scope of the project including how sliding window protocols work, implementing one in C code, and analyzing the requirements for sequence numbers.

Uploaded by

Arindam Guin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 13

Implement of sliding window protocol

A Report of Mini Project on


Data Communication & Computer Networks (BCA-501)
Bachelor of Computer Application

Name – Amartya Saha


MAKAUT ROLL NO - 10401216114 AND MAKAUT REG NO - 161041010007
Name – Amlan Naskar
MAKAUT ROLL NO - 10401216113 AND MAKAUT REG NO - 161041010008
Name – Anubhab Chakrabarty
MAKAUT ROLL NO - 10401216112 AND MAKAUT REG NO - 161041010009
Name – Anushka Bardhan
MAKAUT ROLL NO - 10401216111 AND MAKAUT REG NO – 161041010010
Name – Argho Sinha
MAKAUT ROLL NO - 10401216110 AND MAKAUT REG NO - 161041010011
Name – Arindam Guin
MAKAUT ROLL NO - 10401216109 AND MAKAUT REG NO - 161041010012

DEPARTMENT OF COMPUTER APPLICATION


INSTITUTE OF ENGINEERING & MANAGEMENT
2018
DECLARATION CERTIFICATE

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.

Name of Student: Amartya Saha Name of Student: Anushka Bardhan

WBUT Roll Num: 10401216114 WBUT Roll Num: 10401216111

Name of Student: Amlan Naskar Name of Student: Argho Sinha

WBUT Roll Num: 10401216113 WBUT Roll Num: 10401216110

Name of Student: Anubhab Chakraborty Name of Student: Arindam Guin

WBUT Roll Num: 10401216112 WBUT Roll Num: 10401216109

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

A sliding window protocol is a feature of packet-based data


transmission protocols. Sliding window protocols are used where
reliable in-order delivery of packets is required, such as in
the Data Link Layer (OSI layer 2) as well as in the Transmission
Control Protocol (TCP).
Conceptually, each portion of the transmission (packets in most
data link layers, but bytes in TCP) is assigned a unique
consecutive sequence number, and the receiver uses the
numbers to place received packets in the correct order, discarding
duplicate packets and identifying missing ones. The problem with
this is that there is no limit on the size of the sequence number
that can be required.

4
Chapter 2

2.1 Scope of the project

If the application in the receiving computer processes the data packets at a


slower rate than the sending computer is sending them, the
acknowledgment signal from the receiving computer will tell the sending
computer to decrease the number of packets in the window size in the next
transmission, or to temporarily stop transmission to free the buffer. If, on
the other hand, the receiving application can process the data packets
faster than the sending computer is sending them, the acknowledgment
signal will tell the sending computer to increase the number of packets in
the next transmission.

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

In computer networks sliding window protocol is a method to transmit data


on a network. Sliding window protocol is applied on the Data Link Layer of
OSI model. At data link layer data is in the form of frames. In Networking,
Window simply means a buffer which has data frames that needs to be
transmitted.

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.

Efficiency of Sliding Window Protocol


η = (W*tx)/(tx+2tp)
W = Window Size

tx = Transmission time
tp = Propagation delay
Sliding window works in full duplex mode

Implementing Sliding Window Protocol Program in C

#include<stdio.h>

int main()
{

6
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

Enter window size : 3

Enter number of frames to transmit : 5

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

3.1 block diagram/Work flow diagram

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 ARQ/Selective Reject ARQ is a specific instance of the automatic


repeat-request (ARQ) protocol used to solve sequence number dilemma in
communications.

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

This paper presented the performance analysis of sliding


window protocol for connected nodes and
implementation of sliding window protocol with c program
and with some diagrams to make you clear..

12

You might also like