0% found this document useful (0 votes)
21 views30 pages

DLL Design Issues - Part3

Uploaded by

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

DLL Design Issues - Part3

Uploaded by

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

Computer Network

Data Link Layer

Flow Control

Sejal M Chopra
Assistant Professor - Dept. of Computer Engineering
Don Bosco Institute of Technology, Mumbai
Contents to be discussed

• Flow Control
• Functions and Requirements of Data Link Protocols
• Elementary Data link Protocol types
• Noiseless Channel Protocols: Simplest and Stop and Wait
• Noisy Channel Protocols( Sliding Window):Stop and Wait
ARQ, Go back N ARQ and Selective Repeat ARQ Protocol
• Numerical
Flow Control
Two Approaches:
Feedback-based flow control:
The receiver sends back information to the sender giving it
permission to send more data or at least telling the sender how the
receiver is doing.
Rate-based flow control:
The protocol has a built-in mechanism that limits the rate at which
senders may transmit data, without using feedback from the receiver.
Functions and Requirements of Data
Link Protocol
To ensure that frames are delivered free of errors to the destination station, a
number of requirements are placed on a data link protocol.
The protocols are normally implemented using one of the programming
languages.
The protocol (control mechanism) should be capable of performing:
• The identification of a frame (i.e. recognise the first and last bits of a
frame).
• The transmission of frames of any length up to a given maximum. Any bit
pattern is permitted in a frame.
• The detection of transmission errors.
• The retransmission of frames which were damaged by errors.
• The assurance that no frames were lost.
• In a multidrop configuration -Some mechanism must be used for
preventing conflicts caused by simultaneous transmission by many
stations.
• The detection of failure or abnormal situations for control
and monitoring purposes.
Elementary Data link Protocol Types
Simplest Protocol for Noiseless Channel
In order to appreciate the step by step development of efficient and complex
protocols we will begin with a simple but unrealistic protocol. In this protocol:
• Data are transmitted in one direction only

• The transmitting (Tx) and receiving (Rx) hosts are always ready
• Processing time can be ignored
• Infinite buffer space is available
• No errors occur; i.e. no damaged frames and no lost frames (perfect channel)
Stop and Wait Protocol for Noiseless
Channel
In this protocol we assume that:
• Data is transmitted in one direction only
• No errors occur (perfect channel)
• The receiver can only process the received information at a finite rate
• These assumptions imply that the transmitter cannot send frames at a rate
faster than the receiver can process them.
• The problem here is how to prevent the sender from flooding the receiver

Sender:
Rule 1) Send one data packet at a time.
Rule 2) Send the next packet only after receiving
acknowledgement for the previous.

Receiver:
Rule 1) Send acknowledgement after receiving
and consuming a data packet.
Rule 2) After consuming packet
acknowledgement need to be sent (Flow
Control)
Problems of Stop and Wait Protocol
Assume transmission errors in the frame are detected by the
hardware checksum.
Case 1:Frame/Data is lost:
•Sender waits for ACK for an infinite amount of time.
•Receiver waits for data for an infinite amount of time
•Note : Retransmission happens if a timer is used.

Case 2:ACK is lost:


•Sender waits for ACK for an infinite amount of time.
•Note : Retransmission happens if a timer is used.

•Duplicateframes are accepted at the receiver without the


receiver knowing it.
Problems of Stop and Wait Protocol

Case 3: Delayed ACK/data :


•If the timer times out and then the ACK
is received
•Duplicate frames are accepted at the
receiver without the receiver knowing it.
•Might be wrongly considered as
acknowledgement of some other recent
packet.
Distinguish between a transmitted frame
and a new frame
• Sender put a sequence number in the header of each frame it sends.
The receiver then can check the sequence number of each arriving
frame to see if it is a new frame or a duplicate to be discarded.

• The receiver needs to distinguish only 2 possibilities: a new frame or a


duplicate; a 1-bit sequence number is sufficient.

• At any instant the receiver expects a particular sequence number.

• Any wrong sequence numbered frame arriving at the receiver is


rejected as a duplicate.

• A correctly numbered frame arriving at the receiver is accepted,


passed to the host, and the expected sequence number is incremented
by 1(modulo-2)
Distinguish between a transmitted frame
and a new frame
Parameters for Stop and Wait Protocol
Transmission delay:
Amount of time required to push all the packet's bits into the wire.
Propagation Delay:
Amount of time taken by a packet to make a physical journey from one
router to another router.

Total time taken in sending one data packet:


= (Transmission delay + Propagation delay)packet + (Propagation delay)ACK
= (Transmission delay)packet + 2 x Propagation delay

Transmission delay (Tt)= Packet size / Bandwidth

Propagation Delay = (Distance between routers) / (Velocity of propagation)

Round Trip Time (RTT) = 2* Propagation Delay


Parameters for Stop and Wait Protocol
Efficiency (η) = Useful Time / Total Time
where-
•Useful time = Transmission delay of data packet = (Transmission delay)packet
•Useless time = Time for which sender is forced to wait and do nothing = 2 x
Propagation delay
•Total time = Useful time + Useless time
Parameters for Stop and Wait Protocol
Note-01: Efficiency may also be referred by the following names-
Link Utilization, Sender Utilization, Utilization of Sender

Note-02: Throughput may also be referred by the following names-


Bandwidth Utilization, Effective Bandwidth, Maximum data rate
possible,Maximum achievable throughput

Numericals:
• If the bandwidth of the line is 1.5 Mbps, RTT is 45 msec and
packet size is 1 KB, then find the link utilization in stop and wait.

• If the packet size is 1 KB and propagation time is 15 msec, the


channel capacity is 109 b/sec, then find the transmission time and
utilization of sender in stop and wait protocol.
Need of Piggybacking
Unidirectional assumption in previous elementary protocols is not
generally used
We use full duplex approach

Approach-1:
Two separate communication channels(physical circuits) :Forward
channel for data and Reverse channel for acknowledgement
Problems: 1. Reverse channel bandwidth wasted 2. Cost

Approach 2:
Same circuit for both directions
Problem: Data and acknowledgement are intermixed, can’t differentiate

Approach 3:
Attaching acknowledgement to outgoing data frame: Piggybacking
Piggybacking
• Temporarily delaying transmission of outgoing acknowledgement
so that they can be hooked onto the next outgoing data frame

• Advantage: higher channel bandwidth utilization

Three Cases:
Case1: host has both data and the
acknowledgment to send
Case 2: host does not have any data
to send then it will send only the
acknowledgment
Case3: host has only data to send
then it will send the data along with
the acknowledgment of the last
frame received. The duplicate
acknowledgment will be discarded
by the receiver and the data would
be accepted.
Piggybacking
Complication (Delayed transmission):
How long to wait for a packet to piggyback?
• If longer than sender timeout period then sender retransmits
 Purpose of acknowledgement is lost
Solution for timing complexion
• If a new packet arrives quickly
 Piggybacking
• If no new packet arrives after a receiver ack timeout
 Sending a separate acknowledgement frame

73
SLIDING WINDOW PROTOCOLS
(Noisy Channel)
The next three protocols are bidirectional protocols that belong to a
class called sliding window protocols. (max sending window size,
receiving window size)
•One-bit sliding window protocol or Stop and Wait ARQ (1, 1)
•Go back N ARQ(>1, 1)
•Selective repeat ARQ (>1, >1)
The three differ among themselves in terms of efficiency,
complexity, and buffer requirements.
Each outbound frame contains an n-bit sequence number
-Range: 0 - MAX_SEQ (MAX_SEQ = 2n - 1)
For stop-and-wait, n = 1 restricting the sequence numbers to 0 and
1 only
SENDING & RECEIVING WINDOWS
• At any instance of time
• Sender maintains a set of sequence numbers of frames
permitted to send
• These frames fall within sending window
• Receiver maintains a set of sequence numbers of frames
permitted to accept
• These frames fall within receiving window
• Lower limit, upper limit, and size of two windows need not be the
same - Fixed or variable size
• Senders Window contains frames can be sent or have been sent
but not yet acknowledged – outstanding frames
Stop-and-Wait ARQ Protocol
• In Stop-and-wait, at any point in time, there is only one frame
that is sent and waiting to be acknowledged.(uses half duplex
mode of transmission)
• This is not a good use of transmission medium.
• To improve efficiency, multiple frames should be in transition
while waiting for ACK
• Solution:(Pipelining)- Allowing w frames sent before blocking
Problem: Wait for frames
Solutions:Go-Back N ARQ,
Selective repeat ARQ

Numerical:
In Stop and wait protocol every 4th packet is lost
and we need to send total 10 packets so how many n-2,… are
transmission it took to send all the packets? 87
GO BACK N ARQ Protocol
• Improves efficiency of Stop and Wait by not waiting
• Keep Channel busy by continuing to send frames
• Allow a window of upto Ws outstanding frames
• Use m-bit sequence numbering
• Receiver discards all subsequent frames following an error one, and send no
acknowledgement for those discarded
• Receiving window size = 1 (i.e., frames must be accepted in the order they were
sent)
• Sending window might get full
• If so, re-transmitting unacknowledged frames

 Wasting a lot of timeof bandwidth if error rate is high


GO BACK N ARQ Protocol
Acknowledgements:
Cumulative Ack:
One acknowledgement is used for many packets. The main advantage
is traffic is less. A disadvantage is less reliability as if one ack is the
loss that would mean that all the packets sent are lost.
Independent Ack:
If every packet is going to get acknowledgement independently.
Reliability is high here but a disadvantage is that traffic is also high
since for every packet we are receiving independent ack.
GO BACK N ARQ Protocol
Formula:
Transmission delay (Tt)= Packet size / Bandwidth

Propagation Delay = (Distance between routers) / (Velocity of propagation)

Round Trip Time (RTT) = 2* Propagation Delay

Efficiency Of GBN = N/(1+2a) where a = Tp/Tt


Effective Bandwidth or Throughput = Efficiency * Bandwidth = (N/(1+2a)) * B
Sender Window Size (WS)=N
Receiver Window size is always 1 in GBN.
Minimum sequence numbers required in GBN = N + 1
GO BACK N ARQ Protocol
GO BACK N ARQ Protocol
Numerical:
• A 20 Kbps satellite link has a propagation delay of 400 ms. The
transmitter employs the “go back n ARQ” scheme with n set to
10.Assuming that each frame is 100 bytes long, what is the maximum
data rate possible?

• Station A needs to send a message consisting of 9 packets to station B


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

• In Go back 4, if every 6th packet that is being transmitted is lost and if


total number of packets to be sent is 10, then how many transmissions
will be required?
Selective Repeat ARQ Protocol
• In this technique, only those frames are retransmitted for which
negative acknowledgement (NAK) has been received.
• The receiver storage buffer keeps all the damaged frames on hold until
the frame in error is correctly received.
• The receiver must have an appropriate logic for reinserting the frames
in a correct order.

Numerical:
In Selective Repeat Ws =
5 and we are sending 10
packets where every 5th
packet is lost find
number of
retransmissions?
SELECTIVE REPEAT ARQ
where a is ratio of propagation delay vs transmission delay and
N is number of packets sent.
References

• A.S. Tanenbaum, “Computer Networks”, Pearson


Education, Fourth Edition.
• B.A. Forouzan, “Data Communications and Networking”,
TMH, Fourth Edition.
• https://afteracademy.com/blog/what-is-piggybacking
• https://www.geeksforgeeks.org/sliding-window-protocols-
summary-with-questions/?ref=lbp
THANK YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy