2.3 Flow and Error Control
2.3 Flow and Error Control
EVOCATION
EVOCATION
General Objective:
To understand the concept of framing, error and flow control
Specific Objectives:
• Classify the two different types of framing in data link layer. [T]
Framing:
• Separates a message from one source to a destination or from
other messages to other destination by adding the sender and
destination address
• The size of framing is divided into two,
• Fixed-Size Framing
• Variable-Size Framing
Fixed-Size Framing:
• Here there is no need for defining boundaries of the frames
• Size itself uses the delimiter
• ATM wide-area network, uses frames of fixed size called cells
Variable-Size Framing:
• It is prevalent in local-area network
• Here there is a need to define the end of the frame and beginning
of the next frame
• The two approaches are used for character-oriented and bit-
oriented approach
SO2:Differentiate byte stuffing and bit
stuffing
Character-Oriented Protocol
Problems
• Using of more escape characters
• Usage of Unicode
Bit-Oriented Protocols
Simplest Protocol
• It is a unidirectional Protocol
• Design
Algorithm
• Sender-site algorithm
while (true) //repeat forever
{
WaitForEvent(); //sleep until an event occurs
if (Event (RequestToSent)) //there is a packet to send
{
GetData();
MakeFrame();
SendFrame();
}
}
• Receiver-site algorithm
while (true) //repeat forever
{
WaitForEvent(); //sleep until an event occurs
if (Event (ArrivalNotification)) //Data frame arrived
{
ReceivedFrame();
ExtractData();
DeliverData();
}
}
Stop-and-Wait Protocol
• Design
Algorithm for Sender Site
Algorithm for Receiver Site
Noisy Channels
• Sequence Numbers
• In Stop-and-Wait ARQ, uses the sequence numbers to
number the frames.
• The sequence numbers are based on modulo-2 arithmetic
• Example: if the data field is m bits long, then the sequence
numbers starts from 0 to 2m-1 and repeated
• Acknowledgement Numbers
• In the protocol, the acknowledgement number always
announces in modulo-2 arithmetic of the sequence number of
next frame expected
• Design
• Efficiency
• The channel is very inefficient in thick and long
• By thick, the channel has large bandwidth
• By long, the round-trip delay is long
• Pipelining
• A task is often begun before the previous task has ended
• No pipelining mechanism in Stop-and-Wait ARQ
• Flow Diagram
FORMATIVE ASSESMENT3
• Which protocol waits for confirmation from
the receiver for the frame that was already
send?
(i) Stop-and-Wait
(ii) TCP
(iii) Wait-and-Stop
(iv) UDP
Ans: Stop-and-Wait
FORMATIVE ASSESMENT4
• Sequence numbers in Stop-and-Wait protocol
are based on _______.
(i) Modulo-4 arithmetic
(ii) Modulo-2 arithmetic
(iii) Modulo-6 arithmetic
(iv) Modulo-3 arithmetic
Ans: Modulo-2 arithmetic
Discussion
Mind Map
Character Oriented
Protocols
Fixed Size Framing Variable Size Framing
Framing
Data Link Control
• Framing
– Fixed Size Framing
– Variable Size Framing
• Character Oriented Protocols
– Byte Stuffing
• Bit oriented Protocols
– Bit stuffing
• Flow Control
• Error Control
• Protocols
– Noiseless Channel
– Noisy Channel
Stimulating Questions
• Sequence Numbers
• The size or range of he sequence numbers are ranged from 0
to 2m-1
• In the Go-Back-N Protocol, the sequence numbers are modulo 2m,
where m is the size of the sequence number field in bits
Sliding Window
• It is an abstract concept that defines the range of sequence
numbers that is the concern of sender and receiver
• The send window can slide one or more slots when a valid
acknowledge arrives
• The receive window is an abstract concept defining an imaginary
box of size 1 with one single variable Rn
• Then the correct frame of window slide arrived, sliding occurs one
slot at a time
Timers
• The protocol use only one timer because the first outstanding
frame always expires first
Acknowledgement
• The receiver sends a positive acknowledgement if a frame has
arrived safe and sound
Resending a Frame
• When the timer expires, the sender resends all outstanding frames
• Design
• In Go-Back-N ARQ, the size of the send window must be less than
2m
Selective Repeat ARQ
• The mechanism that does not resend N frames when just one
frame is damaged but can only resend the damaged frame
Windows
• The size of the send window and receive window is same of 2m-1
Sliding Window
Sender Sliding Window
Receiver Sliding Window
Piggy Backing
•Simplex
•Stop-and-Wait Protocol
Sequence number Acknowledgement
number
Sliding window
• Noisy Channels
– Stop-and-Wait ARQ
• Sequence number
• Acknowledgement number
– Go-Back-N ARQ
• Sliding window
– Send window
– Receive window
– Selective repeat ARQ
• Piggybacking
Stimulating Questions
1. Design the two simple algorithms for bit-stuffing. The first adds
bits at the sender; the second removes bits at the receiver.