You are on page 1of 82

Subject: Computer Networking (6ETC01) 3/17/2022

Unit-
Unit-II

SSGMCE, Shegaon Third Year BE


Sixth Semester
Department Session 2021-22
of
Electronics & Telecommunication
Engineering
Communication
Network

Communication Network By: Amit N. Dolas, SSGMCE Shegaon

Unit-
Unit-II Syllabus

Data Link Control Protocols: Need for Flow control, Stop and Wait Flow
Control, Sliding Window Flow Control, Stop and wait ARQ, Go-Back-N
ARQ, Selective Repeat ARQ, Transmission efficiency of ARQ protocols.

Prepared by: Amit N. Dolas, SSGMCE Shegaon 1


Subject: Computer Networking (6ETC01) 3/17/2022

Data Link Control Protocols: Overview

Main Functions of Data Link Layer are:

1. Data Link Control deals with the design and procedures for node-to-node
communication

2. Media Access Control deals with how to share link


Data Link Control functions includes Framing, Flow control and Error control.
Software implemented protocols provide smooth and reliable transmission of
frames between nodes
FRAMING: Data transmission in physical layer means moving bits in the form of a
signal from source to destination. The physical layer provides bit synchronization to
ensure that sender and receiver use the same bit duration and timing.

Data Link Control Protocols: Overview

The Data Link Layer, on the other hand, needs to pack bits into Frames, so that
each frame is distinguishable from other. It adds sender address and destination
address (Header)
Destination address: where the packet is to go
Sender address: helps the recipient acknowledgement receipt

Although, whole message could be packed in one frame, that is not normally done.
When the message is carried in one large frame, even a single bit error would
require the retransmission of the whole message. When the message is divided
into smaller frames, a single bit error affects only that smaller frame and can be
retransmitted.

Prepared by: Amit N. Dolas, SSGMCE Shegaon 2


Subject: Computer Networking (6ETC01) 3/17/2022

Data Link Control Protocols: Overview


Framing in the data link layer separates a frame distinguishable from another frame
Frame = Header + Network layer PDU + Trailer
In packet switched networks, the block of data called frames are exchanged
between nodes, not the bit streams

Node-1 Adaptor-1 Adaptor-2 Node-2

Types of Framing
1. Fixed-Size Framing: frame length/size is fixed and act as delimiter of frame size it doesn't
require additional boundary bits to identify the start and end of the frame
2. Variable-Size Framing: frame length/size is different. So, additional mechanisms are kept to
mark the end of one frame and the beginning of the next frame.

Data Link Control Protocols: Overview


Bit-Oriented Protocol

Byte or Character -Oriented Protocol

Prepared by: Amit N. Dolas, SSGMCE Shegaon 3


Subject: Computer Networking (6ETC01) 3/17/2022

Bit stuffing and un-stuffing

Byte stuffing and un-stuffing

Prepared by: Amit N. Dolas, SSGMCE Shegaon 4


Subject: Computer Networking (6ETC01) 3/17/2022

Data Link Control Protocols: Overview

Flow Control
It is responsible for moving data (frames) from one node to another
Coordinates the amount of data that can be sent before an acknowledgement and
is one of the most important duties of the data link layer
This protocol is a set of procedures that tells the sender how much data it can
transmit before it must wait for an acknowledgement from the receiver
The incoming data must be checked and processed before use, which is quite
slower than the rate of data transmission
For data processing receiver device has a block of memory (Buffer), reserved for
incoming data until they are processed till the time sender has to halt the
transmission

Data Link Control Protocols: Overview

Error Control
Error control is both error detection and error correction. It allows the receiver to
inform the sender of any frame lost or damaged in transmission and coordinate the
retransmission of the same frames by sender
Any time an error is detected in an exchange, specified frames are retransmitted
and this process called Automatic Repeat Request (ARQ)

Physical Addressing and Access Control are also the services provided by Data Link
Layer

Prepared by: Amit N. Dolas, SSGMCE Shegaon 5


Subject: Computer Networking (6ETC01) 3/17/2022

Protocols

Sliding
Window
Protocols

Simplest Protocols

Prepared by: Amit N. Dolas, SSGMCE Shegaon 6


Subject: Computer Networking (6ETC01) 3/17/2022

Simplest Protocols

Simplest protocol is the data link layer


protocol for transmission of frames over
noiseless channel
Assumed that it is an ideal channel i.e. no
frames are lost, duplicated or
damaged/corrupted
Assumed that receiver can immediately
handle any frame it receives with
small/negligible processing time.
It provides unidirectional data transmission
without flow control and error control
facilities
After transmitting one frame, the sender waits
for an some time and transmit the next frame

Simplest Protocols

Simple rules of Flow Control Mechanism


Sender side Rules:
Rule-1: Send data packets serially after a
small interval of time without waiting for
the ACK

Receiver side Rules:


Rule-1: Only consume the data packet as
an when received from the sender

Prepared by: Amit N. Dolas, SSGMCE Shegaon 7


Subject: Computer Networking (6ETC01) 3/17/2022

Simplest Protocols

Advantage:
It is the simplest way for transmission
Disadvantage:
If there are huge number of packets, then it
becomes very time consuming
If DATA lost during transmission:
If particular frame lost in the channel, will not be
received by the receiver and next successive
frame will arrived and handled by the receiver.
Therefore frame sequence may get disturbed
due to missing frame

Simplest Protocols
1 6

2 5

3 4

2 5

Prepared by: Amit N. Dolas, SSGMCE Shegaon 8


Subject: Computer Networking (6ETC01) 3/17/2022

Simplest Protocols

Sender Site Algorithm


For the Simplest
Protocol

Receiver Site Algorithm


For the Simplest
Protocol

Stop-and-wait Protocols

Prepared by: Amit N. Dolas, SSGMCE Shegaon 9


Subject: Computer Networking (6ETC01) 3/17/2022

Stop-and-wait Protocols

Stop-and-wait protocol is the data link


layer protocol for transmission of frames
over noiseless channel

It provides unidirectional data


transmission with flow control facilities
but without error control facilities

After transmitting one frame, the sender


waits for an acknowledgement before
transmitting the next frame

Stop-and-wait Protocols

Simple rules of Flow Control Mechanism


Sender side Rules:
Rule-1: Send one data packet at a time
Rule-2: Send next data packet only after
receiving the AKNOLEDGEMENT for the
previous data packet

Receiver side Rules:


Rule-1: Receive and consume data packet
Rule-2: Send the AKNOLEDGEMENT after
consuming data packet

Prepared by: Amit N. Dolas, SSGMCE Shegaon 10


Subject: Computer Networking (6ETC01) 3/17/2022

Stop-and-wait Protocols
Advantage:
It is the simplest way for transmission
Disadvantage:
If there are huge number of packets, then it
becomes very SLOW and time consuming
If DATA or ACK lost during transmission:
Receiver will wait for DATA for an infinite
amount time
Sender will wait for ACK for an infinite amount
time
If DATA or ACK delayed during transmission:
After timed out by the sender side, a delayed
ACK might be wrongly considered.

Stop-and-wait Protocols

1 5

7 2 4 6

2 4

6 3

Prepared by: Amit N. Dolas, SSGMCE Shegaon 11


Subject: Computer Networking (6ETC01) 3/17/2022

Stop-and-wait Protocols

Stop-and-wait Protocols

Prepared by: Amit N. Dolas, SSGMCE Shegaon 12


Subject: Computer Networking (6ETC01) 3/17/2022

Sliding Window Protocols

Sliding
Window
Protocols

Stop-and-wait ARQ Protocols

Prepared by: Amit N. Dolas, SSGMCE Shegaon 13


Subject: Computer Networking (6ETC01) 3/17/2022

Stop-and-Wait ARQ Protocols

After transmitting one frame


the sender waits for an
acknowledgment before
transmitting the next frame

If the acknowledgment does


not arrive after a certain period
of time the sender times out
and retransmits the original
frame

Stop-and-Wait ARQ =
Stop-and-Wait
+ Time out Timer
+ Sequence Number

Stop-and-Wait ARQ Protocols

Scenario-1: Perfect Operation


Sn Rn
Frame
A sender sends a frame and the receiver receives
it and then the receiver acknowledged it before
Time out

the timer expires (Timed out)


Time

ACK
This is perfect operation as far as Stop-and-Wait
protocol is concerned

Prepared by: Amit N. Dolas, SSGMCE Shegaon 14


Subject: Computer Networking (6ETC01) 3/17/2022

Stop-and-Wait ARQ Protocols

Scenario-2: Original Frame Lost

Sn Rn A sender sends a frame but it goes lost, the receiver


Frame does not receives it and hence no acknowledgement
Time out Time out

before the timer expires (Timed out)


Time

A sender re-transmit the same frame and the


receiver receives it and then the receiver
ACK acknowledged it before the timer expires (Timed out)

This is how stop-and-wait ARQ (Automatic Repeat


Request) is differ from Stop-and-Wait protocol

Stop-and-Wait ARQ Protocols

Scenario-3: Acknowledgement to frame sent is Lost


Sn Rn A sender sends a frame and the receiver receives it,
Frame
but the acknowledgement is lost and not receive by
Time out

the sender before the timer expires (Timed out)


Time

ACK

Frame
A sender re-transmit the same frame after expiry of
timer and the receiver receives it and then the
Time out

receiver acknowledged it before the timer expires


ACK (Timed out)

This is how stop-and-wait ARQ (Automatic Repeat


Request) is differ from Stop-and-Wait protocol

Prepared by: Amit N. Dolas, SSGMCE Shegaon 15


Subject: Computer Networking (6ETC01) 3/17/2022

Stop-and-Wait ARQ Protocols

Scenario-4: Timer has fired too soon- Frame and


Acknowledgement is NOT Lost but the TIME OUT

Sn Rn A sender sends a frame and the receiver receives


Frame
it, but the acknowledgement is DELAYED due to the
delay in the NETWORK after the timer expires
Time out Time out

(Timed out)
Time

ACK

Frame A sender re-transmit the same frame after expiry of


timer and the receiver receives it and then the
ACK receiver acknowledged it before the timer expires
(Timed out)

This is how stop-and-wait ARQ (Automatic Repeat


Request) is differ from Stop-and-Wait protocol

Stop-and-Wait ARQ Protocols

Prepared by: Amit N. Dolas, SSGMCE Shegaon 16


Subject: Computer Networking (6ETC01) 3/17/2022

Sender side Algorithm for Stop-and-Wait ARQ Protocols

Sender side Algorithm for Stop-and-Wait ARQ Protocols

Prepared by: Amit N. Dolas, SSGMCE Shegaon 17


Subject: Computer Networking (6ETC01) 3/17/2022

Receiver side Algorithm for Stop-and-Wait ARQ Protocols

Sliding Window Protocols

Sliding
Window
Protocols

Prepared by: Amit N. Dolas, SSGMCE Shegaon 18


Subject: Computer Networking (6ETC01) 3/17/2022

Sliding Window Protocols

Sliding Window Protocols

Demerits of Stop-and-Wait ARQ


 Only one frame can be sent at a time
 Poor utilization of bandwidth
 Poor performance

Merits Sliding Window Protocol


 Multiple frame can be sent at a time
 Number of frames to be sent is based on WINDOW SIZE
 Each frame is numbered i.e. sequence number

Prepared by: Amit N. Dolas, SSGMCE Shegaon 19


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-1
Total 10 frames are to be sent by the sender (Sn) to receiver (Rn)
The Sliding Window size is 4
Frames are not sent from sender (Sn) to receiver (Rn)

Scenario-2
Frame-0 is sent from sender (Sn) to receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 20


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-3
Frame-1 is sent from sender (Sn) to receiver (Rn)

Scenario-4
Frame-2 is sent from sender (Sn) to receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 21


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-5
Frame-3 is sent from sender (Sn) to receiver (Rn)

Scenario-6
Frame-4 is sent from sender (Sn) to receiver (Rn)
Frame-0 is acknowledge by the receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 22


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-7
Frame-5 is sent from sender (Sn) to receiver (Rn)
Frame-1 is acknowledge by the receiver (Rn)

Scenario-8
Frame-6 is sent from sender (Sn) to receiver (Rn)
Frame-2 is acknowledge by the receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 23


Subject: Computer Networking (6ETC01) 3/17/2022

Frames those are


not yet Sent Frames those are
Sent but not yet Frames those
Acknowledged are Sent and
Acknowledged

Go-Back-N ARQ Protocols

Prepared by: Amit N. Dolas, SSGMCE Shegaon 24


Subject: Computer Networking (6ETC01) 3/17/2022

Go-Back-N ARQ Protocol

N-is the sender window size (Ex. If N=4 then Go-Back-4)


Go-Back-N uses the concept of protocol pipelining. i.e. the sender can send
multiple frames before receiving the acknowledgement for the first frame.
There are finite number of frames and the frames are numbered in a sequential
manner.
The number of frames that can be sent is depends on the sender window size.
If the acknowledgement of the frame is not received within an agreed upon time
period of the sender and receiver, then all the frames in the current window are
re-transmitted.

Go-Back-N ARQ Protocol

The size of the sender window determines the sequence number of the
outbound frames.
If the sender window size is 4 ( i.e. 2^2), then the sequence number will be as
follows 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2 and so on
The sequence bits in the sequence number are TWO to generate binary sequency
like 00, 01, 10, 11

Prepared by: Amit N. Dolas, SSGMCE Shegaon 25


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-1
Total 10 frames are to be sent by the
sender (Sn) to receiver (Rn)
The Go-Back-N Window size is N=4
Frames are not sent from sender (Sn) to receiver (Rn)

Scenario-2
Frame-0 is sent from sender (Sn) to receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 26


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-3
Frame-1 is sent from sender (Sn) to receiver (Rn)

Scenario-4
Frame-2 is sent from sender (Sn) to receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 27


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-5
Frame-3 is sent from sender (Sn) to receiver (Rn)

Scenario-6
Frame-4 is sent from sender (Sn) to receiver (Rn)
Frame-0 is acknowledge by the receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 28


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-7
Frame-5 is sent from sender (Sn) to receiver (Rn)
Frame-1 is acknowledge by the receiver (Rn)

Scenario-8
Frame-5 is sent from sender (Sn) to receiver (Rn)
Frame-2 acknowledgement lost

Prepared by: Amit N. Dolas, SSGMCE Shegaon 29


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-9
Frames in current window (frame-2 to frame-5)
are retransmitted from sender (Sn) to receiver (Rn)
Frame-4 and Frame-5 are discarded

Scenario-9
Frames in current window (frame-2 to frame-5)
are retransmitted from sender (Sn) to receiver (Rn)
Frame-4 and Frame-5 are discarded

Prepared by: Amit N. Dolas, SSGMCE Shegaon 30


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-9
Frames in current window (frame-2 to frame-5)
are retransmitted from sender (Sn) to receiver (Rn)
Frame-4 and Frame-5 are discarded

Scenario-9
Frames in current window (frame-2 to frame-5)
are retransmitted from sender (Sn) to receiver (Rn)
Frame-4 and Frame-5 are discarded

Prepared by: Amit N. Dolas, SSGMCE Shegaon 31


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-10
Frame-2 is acknowledge by the receiver (Rn)
Frame-6 is sent from sender (Sn) to receiver (Rn)

Scenario-10
Frame-2 is acknowledge by the receiver (Rn)
Frame-6 is sent from sender (Sn) to receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 32


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-11
Frame-3 is acknowledge by the receiver (Rn)
Frame-7 is sent from sender (Sn) to receiver (Rn)

Scenario-11
Frame-3 is acknowledge by the receiver (Rn)
Frame-7 is sent from sender (Sn) to receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 33


Subject: Computer Networking (6ETC01) 3/17/2022

Prepared by: Amit N. Dolas, SSGMCE Shegaon 34


Subject: Computer Networking (6ETC01) 3/17/2022

Problem-1: Go-Back-N ARQ Protocol

Station A needs to send a message consisting 9 packets to the station B using a


sliding window of size 3 and go-back-n error control strategy. All the packets are
ready and immediately available for transmission. If every 5th packet the A
transmit gets lost (but no acknowledgement get lost), then what is the number of
packet that A will transmit for sending message to B?

Prepared by: Amit N. Dolas, SSGMCE Shegaon 35


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-1
Total 9 frames are to be sent by the sender (Sn) to
receiver (Rn)
The Sliding Window size is 3
All the frames are not sent from sender (Sn) to
receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 36


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-2
Frame-1 is transmitted by the sender (Sn) to
receiver (Rn)

Scenario-3
Frame-2 is transmitted by the sender (Sn) to
receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 37


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-4
Frame-3 is transmitted by the sender (Sn) to
receiver (Rn)

Scenario-5
Frame-1 is acknowledged by the receiver (Rn)
Frame-4 is transmitted by the sender (Sn) to
receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 38


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-6
Frame-2 is acknowledged by the receiver (Rn)
Frame-5 is transmitted by the sender (Sn) to
receiver (Rn)

Scenario-7
Frame-3 is acknowledged by the receiver (Rn)
Frame-6 is transmitted by the sender (Sn) to
receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 39


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-8
Frame-4 is acknowledged by the receiver (Rn)
Frame-7 is transmitted by the sender (Sn) to
receiver (Rn)

Scenario-9
Frame-5 is Acknowledged LOST
Window Frame-5 to Frame-7 are Re-transmitted
by the sender (Sn) to receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 40


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-10
Frame-5 is acknowledged by the receiver (Rn)
Frame-8 is transmitted by the sender (Sn) to
receiver (Rn)

Scenario-11
Frame-6 is acknowledged by the receiver (Rn)
Frame-9 is transmitted by the sender (Sn) to
receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 41


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-12
Frame-7 is Acknowledged LOST
(10th frame in sequence)
Window Frame-7 to Frame-9 are Re-transmitted
by the sender (Sn) to receiver (Rn)

Scenario-13
Frame-7 is acknowledged by the receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 42


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-14
Frame-8 is acknowledged by the receiver (Rn)

Scenario-15
Frame-9 is Acknowledged LOST
(15th frame in sequence)
Window Frame-9 is Re-transmitted by the sender
(Sn) to receiver (Rn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 43


Subject: Computer Networking (6ETC01) 3/17/2022

Scenario-16
All the Frames are successfully acknowledged by
the receiver (Rn)
All the Frames are successfully transmitted by the
sender (Sn) to receiver (Rn)
TOTAL 16 FRAMES ARE TRANSMITTED

Problem-2: Go-Back-N ARQ Protocol

Host A wants to send a 10 frame to the host B. The host agreed to go with go-
back-4 strategy. How many number of frames transmitted by a host A, if every
6th frame that is transmitted by host A is either corrupted or lost?

Prepared by: Amit N. Dolas, SSGMCE Shegaon 44


Subject: Computer Networking (6ETC01) 3/17/2022

Prepared by: Amit N. Dolas, SSGMCE Shegaon 45


Subject: Computer Networking (6ETC01) 3/17/2022

Prepared by: Amit N. Dolas, SSGMCE Shegaon 46


Subject: Computer Networking (6ETC01) 3/17/2022

Prepared by: Amit N. Dolas, SSGMCE Shegaon 47


Subject: Computer Networking (6ETC01) 3/17/2022

Prepared by: Amit N. Dolas, SSGMCE Shegaon 48


Subject: Computer Networking (6ETC01) 3/17/2022

Prepared by: Amit N. Dolas, SSGMCE Shegaon 49


Subject: Computer Networking (6ETC01) 3/17/2022

Prepared by: Amit N. Dolas, SSGMCE Shegaon 50


Subject: Computer Networking (6ETC01) 3/17/2022

Prepared by: Amit N. Dolas, SSGMCE Shegaon 51


Subject: Computer Networking (6ETC01) 3/17/2022

Prepared by: Amit N. Dolas, SSGMCE Shegaon 52


Subject: Computer Networking (6ETC01) 3/17/2022

Prepared by: Amit N. Dolas, SSGMCE Shegaon 53


Subject: Computer Networking (6ETC01) 3/17/2022

Selective Repeat ARQ Protocols

Prepared by: Amit N. Dolas, SSGMCE Shegaon 54


Subject: Computer Networking (6ETC01) 3/17/2022

Selective Repeat ARQ Protocol

The Go-Back-N protocol that we have studied is efficient if the error


rate and loss of packets is less. Inefficient for noisy channel.

If the connection is poor, there will be frequent loss of packets and the
sender would have to retransmit all the outstanding packets resulting
wastage of the channel bandwidth.

In go-back-n, the size of the receiver window is 1, so it buffers only one


packet in order that it has to acknowledge next and if this expected
packet is lost or corrupted all the received out of order packets are
discarded.

Selective Repeat ARQ Protocol

The sender has to retransmit all the outstanding packets though some
of these may have arrived at the receiver safely but out of order.

This retransmission of packets increases the traffic on the network


creating a cumulative increase in congestion. The alternative approach
for this is Selective Repeat ARQ Protocol.

Prepared by: Amit N. Dolas, SSGMCE Shegaon 55


Subject: Computer Networking (6ETC01) 3/17/2022

Difference between Selective Repeat & Go-Back-N ARQ Protocol

Go-Back-N ARQ Protocol Selective Repeat ARQ Protocol

Retransmits N number of frames in Retransmits only those frames in which


case on an error occurs an error occurs

If error rate is more, then more If error rate is more, then it


wastage of bandwidth comparatively less wastage of bandwidth
Frame sorting and storage is not
Frame sorting and storage is required
required
Complicated as frame storage and sorting
Less complicated
is process needed

Most often used Rarely used due to more complex

Window Size in Selective Repeat ARQ Protocol

In selective repeat ARQ Protocol, both sender and receiver have a sliding window.
On the sender side, the window covers the sequence of packets that are either sent
or can be sent.

At the receiver, the sliding window covers the sequence number of the packets that
are either received or are expected to be received.

In selective repeat, the size of the sender and receiver window is the same.

Prepared by: Amit N. Dolas, SSGMCE Shegaon 56


Subject: Computer Networking (6ETC01) 3/17/2022

Sender Window Size in Selective Repeat ARQ Protocol

1. Sender Window

The sender window in selective repeat is much smaller as compared to the


Go-Back-N protocol. The size of the sender window here is 2m-1. Here m is the
number of bits used by the packet header to express the sequence number of the
corresponding packet.

The sender window covers the packets that are sent but not yet acknowledged, one
that is acknowledged out of order and the one that can be sent once the data for
the corresponding are received by the sender’s application layer.

Sender Window Size in Selective Repeat ARQ Protocol

The size of the sender window here is 2m-1. If m=4 is the number of bits used by the packet
header to express the sequence number 0 to 15 of the corresponding packet.
But the Window Size= 2m-1= 24-1=8 means 0 to 7

Prepared by: Amit N. Dolas, SSGMCE Shegaon 57


Subject: Computer Networking (6ETC01) 3/17/2022

Receiver Window Size in Selective Repeat ARQ Protocol

2. Receiver Window
The maximum size of the receiver window is 2m-1 which is the same as the sender
window. The receiver window covers the sequence number of the packets that are
received out of order and are waiting for the packets that were sent earlier but are
not yet received.
The receiver transport layer does not deliver packets out of order to the application
layer. It waits until a set of consecutive packets are received so that they can be
delivered to the application layer.
In selective repeat, at the sender side, a timer is attached to each sent packet and if
the acknowledgement is not received before the timer expire the corresponding
packet is resent.

Receiver Window Size in Selective Repeat ARQ Protocol

Prepared by: Amit N. Dolas, SSGMCE Shegaon 58


Subject: Computer Networking (6ETC01) 3/17/2022

Design of Selective Repeat ARQ Protocol

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-1 to Frame-4 are ready Frame-1 to Frame-4 are ready


for transmission in the for reception in the sequence
sequence Receiver Window Size=4
Sender Window Size=4

Prepared by: Amit N. Dolas, SSGMCE Shegaon 59


Subject: Computer Networking (6ETC01) 3/17/2022

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-1 is transmitted Frame-1 to Frame-4 are ready


Frame-2 is ready for for reception in the sequence
transmission in the sequence

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-2 is transmitted Frame-1 to Frame-4 are ready


Frame-3 is ready for for reception in the sequence
transmission in the sequence

Prepared by: Amit N. Dolas, SSGMCE Shegaon 60


Subject: Computer Networking (6ETC01) 3/17/2022

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-2 is transmitted Frame-1 is Acknowledged by


Frame-3 is ready for the receiver in the sequence
transmission in the sequence

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-3 is transmitted Frame-1 is Acknowledged by


Frame-4 is ready for the receiver in the sequence
transmission in the sequence

Prepared by: Amit N. Dolas, SSGMCE Shegaon 61


Subject: Computer Networking (6ETC01) 3/17/2022

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-3 is transmitted Frame-2 is Acknowledged by


Frame-4 is ready for the receiver in the sequence
transmission in the sequence

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-4 is transmitted Frame-2 is Acknowledged by


the receiver in the sequence

Prepared by: Amit N. Dolas, SSGMCE Shegaon 62


Subject: Computer Networking (6ETC01) 3/17/2022

Errorless operation of

Sender Side Operation Receiver Side Operation

Window Slide to next Frame-3 is Acknowledged by


sequences the receiver in the sequence
Frame-5 to Frame-8 are ready
for transmission in the
sequence

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-5 is transmitted Frame-3 is Acknowledged by


Frame-6 is ready for the receiver in the sequence
transmission in the sequence

Prepared by: Amit N. Dolas, SSGMCE Shegaon 63


Subject: Computer Networking (6ETC01) 3/17/2022

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-5 is transmitted Frame-4 is Acknowledged by


Frame-6 is ready for the receiver in the sequence
transmission in the sequence

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-6 is transmitted Frame-4 is Acknowledged by


Frame-7 is ready for the receiver in the sequence
transmission in the sequence

Prepared by: Amit N. Dolas, SSGMCE Shegaon 64


Subject: Computer Networking (6ETC01) 3/17/2022

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-6 is transmitted Frame-5 is Acknowledged by


Frame-7 is ready for the receiver in the sequence
transmission in the sequence

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-7 is transmitted Frame-5 is Acknowledged by


Frame-8 is ready for the receiver in the sequence
transmission in the sequence

Prepared by: Amit N. Dolas, SSGMCE Shegaon 65


Subject: Computer Networking (6ETC01) 3/17/2022

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-7 is transmitted Frame-6 is Acknowledged by


Frame-8 is ready for the receiver in the sequence
transmission in the sequence

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-8 is transmitted Frame-6 is Acknowledged by


Window Slide to next the receiver in the sequence
sequences
Frame-9 is ready for
transmission in the sequence

Prepared by: Amit N. Dolas, SSGMCE Shegaon 66


Subject: Computer Networking (6ETC01) 3/17/2022

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-9 is ready for Frame-7 is Acknowledged by


transmission in the sequence the receiver in the sequence

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-9 is transmitted Frame-7 is Acknowledged by


the receiver in the sequence

Prepared by: Amit N. Dolas, SSGMCE Shegaon 67


Subject: Computer Networking (6ETC01) 3/17/2022

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-9 is transmitted Frame-8 is Acknowledged by


the receiver in the sequence

Errorless operation of

Sender Side Operation Receiver Side Operation

Frame-9 is transmitted Frame-9 is Acknowledged by


the receiver in the sequence

Prepared by: Amit N. Dolas, SSGMCE Shegaon 68


Subject: Computer Networking (6ETC01) 3/17/2022

Selective Repeat ARQ Protocol


Operation when Packet/Acknowledgement lost

Host A wants to send a 8 frame to the host B. The host agreed to go with selective
repeat ARQ strategy. Host uses 3-bit frame sequence synchronization, If frame-2
transmitted by a host A is lost or corrupted and frame- 4 has lost
acknowledgement then Draw the timing diagram.

m=3
Number of frames=2m=23=8 (i.e. 0 to 7)
Sender Window size= Sender Window size=2m-1=23-1=4

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Sender window size=4 Receiver window size=4

Frame-0 to Frame-3 are ready Receiver is waiting Frame-0 to


for transmission Frame-3 are ready for
reception

Prepared by: Amit N. Dolas, SSGMCE Shegaon 69


Subject: Computer Networking (6ETC01) 3/17/2022

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-0 is transmitted but not Receiver is waiting Frame-0 to


acknowledged Frame-3 are ready for
reception

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-0 and Frame-1 are Receiver is waiting Frame-0 to


transmitted but not Frame-3 are ready for
acknowledged reception

Prepared by: Amit N. Dolas, SSGMCE Shegaon 70


Subject: Computer Networking (6ETC01) 3/17/2022

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-0 is acknowledged and Frame-0 is received and


Frame-1 is transmitted but not acknowledgment is sent to the
acknowledged sender (Sn)

Therefore, Sender window Therefore, Receiver window


slides by one frame slides by one frame

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-2 is lost during Frame-0 is received and


transmission acknowledgment is sent to the
sender (Sn)

Therefore, Receiver window


slides by one frame

Prepared by: Amit N. Dolas, SSGMCE Shegaon 71


Subject: Computer Networking (6ETC01) 3/17/2022

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-1 is acknowledged and Frame-1 is received and


Frame-2 is lost during acknowledgment is sent to the
transmission sender (Sn)

Therefore, Sender window Therefore, Receiver window


slides by one frame slides by one frame

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-3 is transmitted but not Frame-0 and Frame-1 is


acknowledged receives and acknowledgment
is sent to the sender (Sn)

Prepared by: Amit N. Dolas, SSGMCE Shegaon 72


Subject: Computer Networking (6ETC01) 3/17/2022

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-3 is transmitted but not Frame-0 and Frame-1 is


acknowledged receives and acknowledgment
is sent to the sender (Sn)

Frame-2 is not received as it is


lost during transmission.
Hence, NACK

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-4 is transmitted but not Frame-0 and Frame-1 is


acknowledged receives and acknowledgment
is sent to the sender (Sn)

Frame-2 is not received as it is


lost during transmission.
Hence, NACK

Prepared by: Amit N. Dolas, SSGMCE Shegaon 73


Subject: Computer Networking (6ETC01) 3/17/2022

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-3 is acknowledged Frame-3 received and


acknowledgment is sent to the
However, the sender window sender (Sn)
will not slide due to Frame-2
lost and needs to retransmit However, the receiver window
will not slide due to Frame-2
lost and needs to retransmit

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-5 is transmitted but not Frame-3 received and


acknowledged acknowledgment is sent to the
sender (Sn)
However, the sender window
will not slide due to Frame-2 However, the receiver window
lost and needs to retransmit will not slide due to Frame-2
lost and needs to retransmit

Prepared by: Amit N. Dolas, SSGMCE Shegaon 74


Subject: Computer Networking (6ETC01) 3/17/2022

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-4 acknowledgement is Frame-5 received and


lost acknowledgment is sent to the
Frame-5 is acknowledged sender (Sn)

However, the sender window However, the sender window


will not slide due to Frame-2 will not slide due to Frame-2
and Frame-4 ack lost and needs and Frame-4 ack lost and needs
to retransmit to retransmit

Operation when Packet/Acknowledgement lost

Receiver Side Operation


Sender Side Operation
Frame-2 transmission lost Frame-5 received and
Frame-4 acknowledgement lost acknowledgment is sent to the
are need to retransmit sender (Sn)
Sn and Rn wait for the agreed Sn and Rn wait for the agreed
time and retransmit F-2 and F-4 time and retransmit F-2 and F-4

Prepared by: Amit N. Dolas, SSGMCE Shegaon 75


Subject: Computer Networking (6ETC01) 3/17/2022

Operation when Packet/Acknowledgement lost

Receiver Side Operation


Sender Side Operation
All frames in receiver window
All frames in sender window (F-2 to F-5) have sent
(F-2 to F-5) are transmitted and acknowledgement to sender
acknowledged
Therefore, complete Receiver
Therefore, complete Sender window slides by 4 frames
window slides by 4 frames

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Sender window size=4 Receiver window size=4

Frame-6 to Frame-7are ready Receiver is waiting Frame-6 to


for transmission Frame-7 are ready for reception
Frame-6 transmitted

Prepared by: Amit N. Dolas, SSGMCE Shegaon 76


Subject: Computer Networking (6ETC01) 3/17/2022

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Sender window size=4 Receiver window size=4

Frame-7 transmitted Receiver is waiting Frame-6 to


Frame-7 are ready for reception

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-6 is acknowledged and Frame-6 is received and


Frame-7 is transmitted but not acknowledgment is sent to the
acknowledged sender (Sn)

Therefore, Sender window Therefore, Receiver window


slides by one frame slides by one frame

Prepared by: Amit N. Dolas, SSGMCE Shegaon 77


Subject: Computer Networking (6ETC01) 3/17/2022

Operation when Packet/Acknowledgement lost

Sender Side Operation Receiver Side Operation

Frame-7 is acknowledged Frame-7 is received and


acknowledgment is sent to the
Therefore, Sender window sender (Sn)
slides by one frame
Therefore, Receiver window
slides by one frame

Transmission Efficiency of ARQ Protocols

Prepared by: Amit N. Dolas, SSGMCE Shegaon 78


Subject: Computer Networking (6ETC01) 3/17/2022

Transmission Efficiency of ARQ Protocol


Stop and Wait is a flow control protocol. In which the sender sends one packet and
waits for the receiver to acknowledge and then it will send the next packet. In case if
the acknowledgment is not received, the sender will retransmit the packet. This is
the simplest one and easy to implement. but the main disadvantage is the efficiency
is very low.
Where,
Tt(data) : Transmission delay for Data packet
Tp(data) : Propagation delay for Data packet
Tq: Queuing delay
Tpro: Processing delay
Tt(ack): Transmission delay for acknowledgment
Tp(ack) : Propagation delay for acknowledgment

Transmission Efficiency of ARQ Protocol

Total time taken to send one packet,


= Tt(data) + Tp(data) + Tq + Tpro + Tt(ack) + Tp(ack)
Since, Tp(ack) = Tp(data)
and, Tt(ack) << Tt(data).
So we can neglect Tt(ack)
Tq = 0 and Tpro = 0
Hence, Total time = Tt(data) + 2 * Tp

Prepared by: Amit N. Dolas, SSGMCE Shegaon 79


Subject: Computer Networking (6ETC01) 3/17/2022

Transmission Efficiency of ARQ Protocol

We know that the Efficiency (η),


= Useful time / Total cycle time
= Tt / (Tt + 2*Tp) = 1 / (1+2*(Tp/Tt))
= 1 / (1+2*a)
where, a = Tp / Tt

Transmission Efficiency of ARQ Protocol

Throughput: Number of bits send per second,


which is also known as
Effective Bandwidth or Bandwidth utilization.
Throughput, = L/(Tt + 2*Tp)
= ((L/BW)*BW)/(Tt + 2*Tp)
= Tt/(Tt + 2*Tp) * BW (where, L/BW=Tt)
= 1/(1 + 2a) * BW
Hence, Throughput = η * BW
where, BW : Bandwidth
L : Size of Data packet

Prepared by: Amit N. Dolas, SSGMCE Shegaon 80


Subject: Computer Networking (6ETC01) 3/17/2022

Transmission Efficiency of ARQ Protocol

Factors affecting Efficiency:


n = 1/(1 + 2*(Tp/Tt)
= 1/(1 + 2*(d/v)*(BW/L))
where,
d = distance between source and receiver
v = velocity

Transmission Efficiency of ARQ Protocol

Lets see an example.


Example:
Given,
Tt = 1ms
Tp = 2ms
Bandwidth = 6 Mbps
Efficiency(η) = 1/(1 + 2*a)
= 1/(1 + 2*(2/1))
= 1/5 = 20 %
Throughput = η * BW = (1/5) * 6 = 1.2 Mbps

Prepared by: Amit N. Dolas, SSGMCE Shegaon 81


Subject: Computer Networking (6ETC01) 3/17/2022

Transmission Efficiency of ARQ Protocol

Note: As we can observe from the above given formula of Efficiency that:
On increasing the distance between source and receiver the Efficiency will
decrease. Hence, Stop and Wait is only suitable for small area network like LAN. It is
not suitable for MAN or WAN, as the efficiency will be very low.
If we increase the size of the Data packet, the efficiency is going to increase. Hence,
it is suitable not for small packets. Big data packets can be send by Stop and Wait
efficiently.

Communication Network By: Amit N. Dolas, SSGMCE Shegaon

Prepared by: Amit N. Dolas, SSGMCE Shegaon 82

You might also like