Professional Documents
Culture Documents
Unit-
Unit-II
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.
1. Data Link Control deals with the design and procedures for node-to-node
communication
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.
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.
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
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
Protocols
Sliding
Window
Protocols
Simplest Protocols
Simplest Protocols
Simplest Protocols
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
Simplest Protocols
Stop-and-wait Protocols
Stop-and-wait Protocols
Stop-and-wait Protocols
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
Stop-and-wait Protocols
Stop-and-wait Protocols
Sliding
Window
Protocols
Stop-and-Wait ARQ =
Stop-and-Wait
+ Time out Timer
+ Sequence Number
ACK
This is perfect operation as far as Stop-and-Wait
protocol is concerned
ACK
Frame
A sender re-transmit the same frame after expiry of
timer and the receiver receives it and then the
Time out
(Timed out)
Time
ACK
Sliding
Window
Protocols
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)
Scenario-3
Frame-1 is sent from sender (Sn) to receiver (Rn)
Scenario-4
Frame-2 is sent from sender (Sn) to receiver (Rn)
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)
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)
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
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)
Scenario-3
Frame-1 is sent from sender (Sn) to receiver (Rn)
Scenario-4
Frame-2 is sent from sender (Sn) to receiver (Rn)
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)
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
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
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
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
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?
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.
The sender has to retransmit all the outstanding packets though some
of these may have arrived at the receiver safely but out of order.
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.
1. Sender Window
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.
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
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.
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
Errorless operation of
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
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.