Sie sind auf Seite 1von 53

ALPHA BREATHING

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]

• Differentiate byte stuffing and bit stuffing [T]

• Illustrate the mechanism of simplest and stop-and-wait protocol


in noiseless protocols. [T]
• Explain the stop-and-wait ARQ protocol with a neat diagram
SO1: Classify the two different types of
framing in data link layer
FRAMING

• Provides smooth and reliable transmission of frames between


nodes
• The Data Link Control functions include framing, flow and error
control, and software implemented protocols

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

• Data carried in 8-bit characters from a coding system as ASCII


• Header carries source and destination address and other
information
• Trailer carries error detection or correction redundant bits, also
multiples of 8 bits
• Flag is used to separate one frame from other
• Flag could select any character not used for text communication
• Byte-stuffing strategy, a special byte is added to the data section
of the frame
Character-Oriented Protocol

• The data section is stuffed with an extra byte, usually called


escape character (ESC)
• In general, byte stuffing is a process of adding 1 extra byte
whenever there is a flag or escape character in the text

Problems
• Using of more escape characters
• Usage of Unicode
Bit-Oriented Protocols

• Data section of frames is a sequence of bits to be interpreted by


the upper layer

• Here the problems of byte-stuffing is overcome by using bit-


stuffing

• Bit stuffing is a process of adding one extra 0 whenever five


consecutive 1s follow a 0 in the data, so that the receiver does not
mistake the pattern 0111110 for a flag
Flow and Error Control
• Flow control refers to a set of procedures used to restrict the
amount of data that the sender can send before waiting for
acknowledgement
• Error control in the data link layer is based on automatic repeat
request, which is the retransmission of data
Protocols

Noiseless Channel Noisy Channel

Simplest Stop and Wait Stop-and- Go-Back- Selective


Wait ARQ N ARQ Repeat ARQ
FORMATIVE ASSESMENT1
• _____ is the process of adding one extra byte
whenever there is a flag or escape character in
the text.
(i) Bit stuffing
(ii) Byte stuffing
(iii) Framing
(iv) Jitter
Ans: Byte stuffing
FORMATIVE ASSESMENT2
• ARQ refers to _____
(i) Atomic Regular Request
(ii) Automatic Regular Request
(iii) Automatic Repeat Request
(iv) Atomic Repeat Request
Ans: Automatic Repeat Request
SO3:Illustrate the mechanism of simplest and
stop-and-wait protocol in noiseless protocols
Noiseless Channels

• The noiseless channels does not uses error control mechanisms


• These channels uses flow control mechanisms
• It is of two types of protocols,
• Simplest Protocol
• Stop and Wait Protocol

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

• The sender sends one frame, stops until it receives confirmation


from the receiver and then sends another frame

• It is also unidirectional communication for data frames but


receives ACK frames travel from another direction

• Design
Algorithm for Sender Site
Algorithm for Receiver Site
Noisy Channels

• These type of channels are used for performing error control


mechanisms

• There are different types of protocols in noisy channels,

• Stop-and-Wait Automatic Repeat Request


• Go-Back-N Automatic Repeat Request
• Selective Repeat Automatic Repeat Request
Stop-and-Wait Automatic Repeat Request

• Simply adds error control mechanism to Stop-and-Wait Protocol

• Error correction in Stop-and-Wait ARQ is done by keeping a copy


of the sent frame and retransmitting of the frame when the timer
expires

• 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

Bit oriented Protocols

Framing
Data Link Control

Protocols Error Control &


Flow Control

Noisy Channel Noiseless


Channel

•Stop and wait ARQ


•Simplex
•Go Back-N ARQ
•Stop-and-Wait Protocol
•Selective Repeat ARQ
Summary

• 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

If we want to be able to detect two-bit errors, what should be the


minimum hamming distance?
Go-Back-N Automatic Repeat Request

• To improve the efficiency of transmission, multiple frames must


be in transition while waiting for acknowledge

• In this protocol, several frames can be send before receiving the


acknowledgements but the copy of send frames has been
maintained

• 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 range which is concern of the sender is called sender sliding


window

• The range that is concern of the receiver is called the receive


sliding window
• The maximum size of the window is 2m-1
• In window at any time the sequence numbers are divided into four
regions
• Frames that are already acknowledged
• Frames sent but no acknowledgement
• Frames that can be sent, but not received from upper layer
• Frames that cannot be sent

• The send window is an abstract concept defining an imaginary box


of size 2m-1 with three variables of Sf, Sn, Ssize

• 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

• It is also a unidirectional protocol

• The mechanism that does not resend N frames when just one
frame is damaged but can only resend the damaged frame

• It is more efficient for noisy links but the processing at receiver is


more complex

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

• Technique to improve the efficiency of bidirectional protocols

• There are three types of events involved in piggybacking: request,


arrival and time-out

• An important point about piggybacking is that both sites must use


the same algorithm

• This is complicated because it needs to combine two arrival events


into one
Damaged Frame
Damaged Frame
Lost Frame
Lost ACK
Selective Reject
Discussion
Mind Map
Design

Selective Repeat ARQ

Data Link Control

Noisy Channel Noiseless Channel

Stop and waitARQ


Go Back-N ARQ

•Simplex
•Stop-and-Wait Protocol
Sequence number Acknowledgement
number

Sliding window

Send window Receive window


Summary
• Framing
– Fixed Size Framing
– Variable Size Framing
• Character Oriented Protocols
– Byte Stuffing
• Bit oriented Protocols
– Bit stuffing
• Flow Control
• Error Control
• Noiseless Channels
– Simplest protocol
– Stop-and-Wait protocol
Summary

• 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.

2. Design the bi-directional algorithm for the stop-and-wait


protocol using piggybacking. Note that both parties need to use
the same algorithm.

Das könnte Ihnen auch gefallen