SlideShare une entreprise Scribd logo
1  sur  22
Flow and Error Control
Sanchita Mal-Sarkar
Ref: Data Communications and
Networking by Behrouz A. Forouzan
McGraw-Hill
Flow Control
• Flow control coordinates the amount of data that can be sent
before receiving acknowledgement
• It is one of the most important functions of data link layer.
• Flow control 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.
• Receiver has a limited speed at which it can process incoming
data and a limited amount of memory in which to store
incoming data.
• Receiver must inform the sender before the limits are reached
and request that the transmitter to send fewer frames or stop
temporarily.
• Since the rate of processing is often slower than the rate of
transmission, receiver has a block of memory (buffer) for
storing incoming data until they are processed.
Error Control
• Error control includes both error detection
and error correction.
• It allows the receiver to inform the sender if a
frame is lost or damaged during transmission
and coordinates the retransmission of those
frames by the sender.
• Error control in the data link layer is based
on automatic repeat request (ARQ).
Whenever an error is detected, specified
frames are retransmitted.
Error and Flow Control Mechanisms
• Stop-and-Wait
• Go-Back-N ARQ
• Selective-Repeat ARQ
Stop-and-Wait
 Sender keeps a copy of the last frame until
it receives an acknowledgement.
 For identification, both data frames and
acknowledgements (ACK) frames are
numbered alternatively 0 and 1.
 Sender has a control variable (S) that
holds the number of the recently sent
frame. (0 or 1)
 Receiver has a control variable ® that
holds the number of the next frame
expected (0 or 1).
 Sender starts a timer when it sends a
frame. If an ACK is not received within a
allocated time period, the sender assumes
that the frame was lost or damaged and
resends it
 Receiver send only positive ACK if the
frame is intact.
 ACK number always defines the number of
the next expected frame
Stop-and-Wait ARQ, lost frame
• When a receiver
receives a damaged
frame, it discards it
and keeps its value of
R.
• After the timer at the
sender expires,
another copy of frame
1 is sent.
Stop-and-Wait, lost ACK frame
• If the sender receives
a damaged ACK, it
discards it.
• When the timer of
the sender expires,
the sender
retransmits frame 1.
• Receiver has already
received frame 1 and
expecting to receive
frame 0 (R=0).
Therefore it discards
the second copy of
frame 1.
Stop-and-Wait, delayed ACK frame
• The ACK can be
delayed at the
receiver or due to
some problem
• It is received after the
timer for frame 0 has
expired.
• Sender retransmitted
a copy of frame 0.
However, R =1 means
receiver expects to
see frame 1. Receiver
discards the duplicate
frame 0.
• Sender receives 2
ACKs, it discards the
second ACK.
Piggybacking
• A method to combine
a data frame with
ACK.
• Station A and B both
have data to send.
• Instead of sending
separately, station A
sends a data frame
that includes an ACK.
• Station B does the
same thing.
• Piggybacking saves
bandwidth.
Disadvantage of Stop-and-Wait
• In stop-and-wait, at any point in time, there is
only one frame that is sent and waiting to be
acknowledged.
• This is not a good use of transmission medium.
• To improve efficiency, multiple frames should be
in transition while waiting for ACK.
• Two protocol use the above concept,
– Go-Back-N ARQ
– Selective Repeat ARQ
Go-Back-N ARQ
• We can send up to W frames before worrying
about ACKs.
• We keep a copy of these frames until the ACKs
arrive.
• This procedure requires additional features to
be added to Stop-and-Wait ARQ.
Sequence Numbers
• Frames from a sender are numbered sequentially.
• We need to set a limit since we need to include the
sequence number of each frame in the header.
• If the header of the frame allows m bits for sequence
number, the sequence numbers range from 0 to 2 m
–
1. for m = 3, sequence numbers are: 1, 2, 3, 4, 5, 6, 7.
• We can repeat the sequence number.
• Sequence numbers are:
0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, …
Sender Sliding Window
• At the sending site, to hold
the outstanding frames
until they are
acknowledged, we use the
concept of a window.
• The size of the window is
at most 2m
-1 where m is
the number of bits for the
sequence number.
• Size of the window can be
variable, e.g. TCP.
• The window slides to
include new unsent
frames when the correct
ACKs are received
Receiver Sliding Window
• Size of the window at
the receiving site is
always 1 in this
protocol.
• Receiver is always
looking for a specific
frame to arrive in a
specific order.
• Any frame arriving out
of order is discarded
and needs to be resent.
• Receiver window slides
as shown in fig. Receiver
is waiting for frame 0 in
part a.
Control Variables
• Sender has 3 variables: S, SF, and SL
• S holds the sequence number of recently sent frame
• SF holds the sequence number of the first frame
• SL holds the sequence number of the last frame
• Receiver only has the one variable, R, that holds the sequence number
of the frame it expects to receive. If the seq. no. is the same as the
value of R, the frame is accepted, otherwise rejected.
Acknowledgement
• Receiver sends positive ACK if a frame arrived safe and in order.
• If the frames are damaged/out of order, receiver is silent and
discard all subsequent frames until it receives the one it is
expecting.
• The silence of the receiver causes the timer of the
unacknowledged frame to expire.
• Then the sender resends all frames, beginning with the one with
the expired timer.
• For example, suppose the sender has sent frame 6, but the timer
for frame 3 expires (i.e. frame 3 has not been acknowledged),
then the sender goes back and sends frames 3, 4, 5, 6 again. Thus
it is called Go-Back-N-ARQ
• The receiver does not have to acknowledge each frame received,
it can send one cumulative ACK for several frames.
Go-Back-N ARQ, normal operation
• The sender keeps track of the outstanding frames and
updates the variables and windows as the ACKs arrive.
Go-Back-N ARQ, lost frame
• Frame 2 is lost
• When the
receiver receives
frame 3, it
discards frame 3
as it is expecting
frame 2
(according to
window).
• After the timer
for frame 2
expires at the
sender site, the
sender sends
frame 2 and 3.
(go back to 2)
Go-Back-N ARQ, damaged/lost/delayed ACK
• If an ACK is damaged/lost, we can have two situations:
• If the next ACK arrives before the expiration of any
timer, there is no need for retransmission of frames
because ACKs are cumulative in this protocol.
• If ACK1, ACK2, and ACk3 are lost, ACK4 covers them if it
arrives before the timer expires.
• If ACK4 arrives after time-out, the last frame and all the
frames after that are resent.
• Receiver never resends an ACK.
• A delayed ACK also triggers the resending of frames
Go-Back-N ARQ, sender window size
• Size of the sender window must be less than 2 m
. Size of the receiver
is always 1. If m = 2, window size = 2 m
– 1 = 3.
• Fig compares a window size of 3 and 4.
Accepts as the
1st
frame in
the next
cycle-an
error
Selective Repeat ARQ, sender and receiver windows
• Go-Back-N ARQ simplifies the process at the receiver site. Receiver only keeps
track of only one variable, and there is no need to buffer out-of-order frames,
they are simply discarded.
• However, Go-Back-N ARQ protocol is inefficient for noisy link. It bandwidth
inefficient and slows down the transmission.
• In Selective Repeat ARQ, only the damaged frame is resent. More bandwidth
efficient but more complex processing at receiver.
• It defines a negative ACK (NAK) to report the sequence number of a damaged
frame before the timer expires.
Selective Repeat ARQ, lost frame • Frames 0 and 1
are accepted
when received
because they
are in the range
specified by the
receiver
window. Same
for frame 3.
• Receiver sends a
NAK2 to show
that frame 2 has
not been
received and
then sender
resends only
frame 2 and it is
accepted as it is
in the range of
the window.

Contenu connexe

Tendances

Transmission impairments(presentation)
Transmission impairments(presentation)Transmission impairments(presentation)
Transmission impairments(presentation)Vivek Kumar
 
HDLC(High level Data Link Control)
HDLC(High level Data Link Control)HDLC(High level Data Link Control)
HDLC(High level Data Link Control)sonangrai
 
CSMA /CD PPT ON SLIDESHARE
CSMA /CD PPT ON SLIDESHARECSMA /CD PPT ON SLIDESHARE
CSMA /CD PPT ON SLIDESHAREKhushboo Pal
 
Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)k33a
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer servicesMelvin Cabatuan
 
Chapter 11: Data Link Control
Chapter 11: Data Link ControlChapter 11: Data Link Control
Chapter 11: Data Link ControlJeoffnaRuth
 
data-link layer protocols
data-link layer protocols  data-link layer protocols
data-link layer protocols BE Smârt
 
Simplex stop and_wait_protocol
Simplex stop and_wait_protocolSimplex stop and_wait_protocol
Simplex stop and_wait_protocolMusfira Ameer
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSDr. SELVAGANESAN S
 
Congestion control
Congestion controlCongestion control
Congestion controlAman Jaiswal
 
Unicasting , Broadcasting And Multicasting New
Unicasting , Broadcasting And Multicasting NewUnicasting , Broadcasting And Multicasting New
Unicasting , Broadcasting And Multicasting Newtechbed
 
Transport protocols
Transport protocolsTransport protocols
Transport protocolsOnline
 
ATM Networking Concept
ATM Networking ConceptATM Networking Concept
ATM Networking ConceptTushar Ranjan
 

Tendances (20)

Transport layer protocol
Transport layer protocolTransport layer protocol
Transport layer protocol
 
Transmission impairments(presentation)
Transmission impairments(presentation)Transmission impairments(presentation)
Transmission impairments(presentation)
 
Congestion control
Congestion controlCongestion control
Congestion control
 
Stop-and-Wait ARQ Protocol
Stop-and-Wait ARQ ProtocolStop-and-Wait ARQ Protocol
Stop-and-Wait ARQ Protocol
 
HDLC(High level Data Link Control)
HDLC(High level Data Link Control)HDLC(High level Data Link Control)
HDLC(High level Data Link Control)
 
CSMA /CD PPT ON SLIDESHARE
CSMA /CD PPT ON SLIDESHARECSMA /CD PPT ON SLIDESHARE
CSMA /CD PPT ON SLIDESHARE
 
Transport layer
Transport layer Transport layer
Transport layer
 
Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer services
 
Chapter 11: Data Link Control
Chapter 11: Data Link ControlChapter 11: Data Link Control
Chapter 11: Data Link Control
 
data-link layer protocols
data-link layer protocols  data-link layer protocols
data-link layer protocols
 
Simplex stop and_wait_protocol
Simplex stop and_wait_protocolSimplex stop and_wait_protocol
Simplex stop and_wait_protocol
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
 
Quality of Service
Quality of ServiceQuality of Service
Quality of Service
 
Multiplexing
MultiplexingMultiplexing
Multiplexing
 
Congestion control in TCP
Congestion control in TCPCongestion control in TCP
Congestion control in TCP
 
Congestion control
Congestion controlCongestion control
Congestion control
 
Unicasting , Broadcasting And Multicasting New
Unicasting , Broadcasting And Multicasting NewUnicasting , Broadcasting And Multicasting New
Unicasting , Broadcasting And Multicasting New
 
Transport protocols
Transport protocolsTransport protocols
Transport protocols
 
ATM Networking Concept
ATM Networking ConceptATM Networking Concept
ATM Networking Concept
 

Similaire à 8th lec flow and error control

Computer network slides for easy prepration
Computer network slides for easy preprationComputer network slides for easy prepration
Computer network slides for easy preprationmqasimsheikh5
 
Flow control & error control
Flow control & error controlFlow control & error control
Flow control & error controlManishTadhiyal
 
Sliding window protocol(ARQ technique)
Sliding window protocol(ARQ technique)Sliding window protocol(ARQ technique)
Sliding window protocol(ARQ technique)shilpa patel
 
session -7 - Sliding Window Protocol 1- N oisy Channels.ppt
session -7 - Sliding Window Protocol 1- N oisy Channels.pptsession -7 - Sliding Window Protocol 1- N oisy Channels.ppt
session -7 - Sliding Window Protocol 1- N oisy Channels.pptnanisrikar276711
 
Unit IV_Flow.pptx
Unit IV_Flow.pptxUnit IV_Flow.pptx
Unit IV_Flow.pptxTejasRao8
 
Go back-n protocol
Go back-n protocolGo back-n protocol
Go back-n protocolSTEFFY D
 
Data Link Control Protocols
Data Link Control ProtocolsData Link Control Protocols
Data Link Control ProtocolsTechiNerd
 
Different protocols for data communication networks
Different protocols for data communication networks Different protocols for data communication networks
Different protocols for data communication networks Nt Arvind
 
Module15: Sliding Windows Protocol and Error Control
Module15: Sliding Windows Protocol and Error Control Module15: Sliding Windows Protocol and Error Control
Module15: Sliding Windows Protocol and Error Control gondwe Ben
 
Data Link Control.ppt
Data Link Control.pptData Link Control.ppt
Data Link Control.pptTeshome48
 
a_presentation_on_hdlc_and_dlc_computer.ppt
a_presentation_on_hdlc_and_dlc_computer.ppta_presentation_on_hdlc_and_dlc_computer.ppt
a_presentation_on_hdlc_and_dlc_computer.pptBlackHat41
 

Similaire à 8th lec flow and error control (20)

Flow control main
Flow control mainFlow control main
Flow control main
 
Computer network slides for easy prepration
Computer network slides for easy preprationComputer network slides for easy prepration
Computer network slides for easy prepration
 
Flow control & error control
Flow control & error controlFlow control & error control
Flow control & error control
 
Sliding window protocol(ARQ technique)
Sliding window protocol(ARQ technique)Sliding window protocol(ARQ technique)
Sliding window protocol(ARQ technique)
 
session -7 - Sliding Window Protocol 1- N oisy Channels.ppt
session -7 - Sliding Window Protocol 1- N oisy Channels.pptsession -7 - Sliding Window Protocol 1- N oisy Channels.ppt
session -7 - Sliding Window Protocol 1- N oisy Channels.ppt
 
Transport layer protocols : Simple Protocol , Stop and Wait Protocol , Go-Bac...
Transport layer protocols : Simple Protocol , Stop and Wait Protocol , Go-Bac...Transport layer protocols : Simple Protocol , Stop and Wait Protocol , Go-Bac...
Transport layer protocols : Simple Protocol , Stop and Wait Protocol , Go-Bac...
 
Go back.pptx
Go back.pptxGo back.pptx
Go back.pptx
 
Protocols
ProtocolsProtocols
Protocols
 
Unit IV_Flow.pptx
Unit IV_Flow.pptxUnit IV_Flow.pptx
Unit IV_Flow.pptx
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Go back-n protocol
Go back-n protocolGo back-n protocol
Go back-n protocol
 
Flow Control
Flow ControlFlow Control
Flow Control
 
PROTOCOL ICT.pptx
PROTOCOL ICT.pptxPROTOCOL ICT.pptx
PROTOCOL ICT.pptx
 
Data Link Control Protocols
Data Link Control ProtocolsData Link Control Protocols
Data Link Control Protocols
 
Flow Control.pptx
Flow Control.pptxFlow Control.pptx
Flow Control.pptx
 
Different protocols for data communication networks
Different protocols for data communication networks Different protocols for data communication networks
Different protocols for data communication networks
 
Module15: Sliding Windows Protocol and Error Control
Module15: Sliding Windows Protocol and Error Control Module15: Sliding Windows Protocol and Error Control
Module15: Sliding Windows Protocol and Error Control
 
Data Link Control.ppt
Data Link Control.pptData Link Control.ppt
Data Link Control.ppt
 
a_presentation_on_hdlc_and_dlc_computer.ppt
a_presentation_on_hdlc_and_dlc_computer.ppta_presentation_on_hdlc_and_dlc_computer.ppt
a_presentation_on_hdlc_and_dlc_computer.ppt
 

Plus de Inocentshuja Ahmad (20)

Bottom up parser
Bottom up parserBottom up parser
Bottom up parser
 
7th lec overview - latest
7th lec   overview - latest7th lec   overview - latest
7th lec overview - latest
 
6th lec infrared slides
6th lec   infrared slides6th lec   infrared slides
6th lec infrared slides
 
5th lec ofdm
5th lec   ofdm5th lec   ofdm
5th lec ofdm
 
3rd lec fcss
3rd lec   fcss3rd lec   fcss
3rd lec fcss
 
2nd lec wireless terminologies
2nd lec   wireless terminologies2nd lec   wireless terminologies
2nd lec wireless terminologies
 
1st lec generations
1st lec   generations1st lec   generations
1st lec generations
 
4rth lec dsss
4rth lec   dsss4rth lec   dsss
4rth lec dsss
 
Mcq's
Mcq'sMcq's
Mcq's
 
Long questions
Long questionsLong questions
Long questions
 
Lecture notes on mobile communication
Lecture notes on mobile communicationLecture notes on mobile communication
Lecture notes on mobile communication
 
Gsm
GsmGsm
Gsm
 
Lecture5 mobile communication_short
Lecture5 mobile communication_short Lecture5 mobile communication_short
Lecture5 mobile communication_short
 
Chapter 10:Risk and Refinements In Capital Budgeting
Chapter 10:Risk and Refinements In Capital BudgetingChapter 10:Risk and Refinements In Capital Budgeting
Chapter 10:Risk and Refinements In Capital Budgeting
 
Chapter 9:Capital Budgeting Techniques
Chapter 9:Capital Budgeting TechniquesChapter 9:Capital Budgeting Techniques
Chapter 9:Capital Budgeting Techniques
 
Chapter 5:Risk and Return
Chapter 5:Risk and ReturnChapter 5:Risk and Return
Chapter 5:Risk and Return
 
Question and answer Programming
Question and answer ProgrammingQuestion and answer Programming
Question and answer Programming
 
Email security & threads
Email security & threadsEmail security & threads
Email security & threads
 
Chapter03 Top Down Design with Function
Chapter03 Top Down Design with FunctionChapter03 Top Down Design with Function
Chapter03 Top Down Design with Function
 
File System FAT And NTFS
File System FAT And NTFSFile System FAT And NTFS
File System FAT And NTFS
 

Dernier

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Dernier (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

8th lec flow and error control

  • 1. Flow and Error Control Sanchita Mal-Sarkar Ref: Data Communications and Networking by Behrouz A. Forouzan McGraw-Hill
  • 2. Flow Control • Flow control coordinates the amount of data that can be sent before receiving acknowledgement • It is one of the most important functions of data link layer. • Flow control 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. • Receiver has a limited speed at which it can process incoming data and a limited amount of memory in which to store incoming data. • Receiver must inform the sender before the limits are reached and request that the transmitter to send fewer frames or stop temporarily. • Since the rate of processing is often slower than the rate of transmission, receiver has a block of memory (buffer) for storing incoming data until they are processed.
  • 3. Error Control • Error control includes both error detection and error correction. • It allows the receiver to inform the sender if a frame is lost or damaged during transmission and coordinates the retransmission of those frames by the sender. • Error control in the data link layer is based on automatic repeat request (ARQ). Whenever an error is detected, specified frames are retransmitted.
  • 4. Error and Flow Control Mechanisms • Stop-and-Wait • Go-Back-N ARQ • Selective-Repeat ARQ
  • 5. Stop-and-Wait  Sender keeps a copy of the last frame until it receives an acknowledgement.  For identification, both data frames and acknowledgements (ACK) frames are numbered alternatively 0 and 1.  Sender has a control variable (S) that holds the number of the recently sent frame. (0 or 1)  Receiver has a control variable ® that holds the number of the next frame expected (0 or 1).  Sender starts a timer when it sends a frame. If an ACK is not received within a allocated time period, the sender assumes that the frame was lost or damaged and resends it  Receiver send only positive ACK if the frame is intact.  ACK number always defines the number of the next expected frame
  • 6. Stop-and-Wait ARQ, lost frame • When a receiver receives a damaged frame, it discards it and keeps its value of R. • After the timer at the sender expires, another copy of frame 1 is sent.
  • 7. Stop-and-Wait, lost ACK frame • If the sender receives a damaged ACK, it discards it. • When the timer of the sender expires, the sender retransmits frame 1. • Receiver has already received frame 1 and expecting to receive frame 0 (R=0). Therefore it discards the second copy of frame 1.
  • 8. Stop-and-Wait, delayed ACK frame • The ACK can be delayed at the receiver or due to some problem • It is received after the timer for frame 0 has expired. • Sender retransmitted a copy of frame 0. However, R =1 means receiver expects to see frame 1. Receiver discards the duplicate frame 0. • Sender receives 2 ACKs, it discards the second ACK.
  • 9. Piggybacking • A method to combine a data frame with ACK. • Station A and B both have data to send. • Instead of sending separately, station A sends a data frame that includes an ACK. • Station B does the same thing. • Piggybacking saves bandwidth.
  • 10. Disadvantage of Stop-and-Wait • In stop-and-wait, at any point in time, there is only one frame that is sent and waiting to be acknowledged. • This is not a good use of transmission medium. • To improve efficiency, multiple frames should be in transition while waiting for ACK. • Two protocol use the above concept, – Go-Back-N ARQ – Selective Repeat ARQ
  • 11. Go-Back-N ARQ • We can send up to W frames before worrying about ACKs. • We keep a copy of these frames until the ACKs arrive. • This procedure requires additional features to be added to Stop-and-Wait ARQ.
  • 12. Sequence Numbers • Frames from a sender are numbered sequentially. • We need to set a limit since we need to include the sequence number of each frame in the header. • If the header of the frame allows m bits for sequence number, the sequence numbers range from 0 to 2 m – 1. for m = 3, sequence numbers are: 1, 2, 3, 4, 5, 6, 7. • We can repeat the sequence number. • Sequence numbers are: 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, …
  • 13. Sender Sliding Window • At the sending site, to hold the outstanding frames until they are acknowledged, we use the concept of a window. • The size of the window is at most 2m -1 where m is the number of bits for the sequence number. • Size of the window can be variable, e.g. TCP. • The window slides to include new unsent frames when the correct ACKs are received
  • 14. Receiver Sliding Window • Size of the window at the receiving site is always 1 in this protocol. • Receiver is always looking for a specific frame to arrive in a specific order. • Any frame arriving out of order is discarded and needs to be resent. • Receiver window slides as shown in fig. Receiver is waiting for frame 0 in part a.
  • 15. Control Variables • Sender has 3 variables: S, SF, and SL • S holds the sequence number of recently sent frame • SF holds the sequence number of the first frame • SL holds the sequence number of the last frame • Receiver only has the one variable, R, that holds the sequence number of the frame it expects to receive. If the seq. no. is the same as the value of R, the frame is accepted, otherwise rejected.
  • 16. Acknowledgement • Receiver sends positive ACK if a frame arrived safe and in order. • If the frames are damaged/out of order, receiver is silent and discard all subsequent frames until it receives the one it is expecting. • The silence of the receiver causes the timer of the unacknowledged frame to expire. • Then the sender resends all frames, beginning with the one with the expired timer. • For example, suppose the sender has sent frame 6, but the timer for frame 3 expires (i.e. frame 3 has not been acknowledged), then the sender goes back and sends frames 3, 4, 5, 6 again. Thus it is called Go-Back-N-ARQ • The receiver does not have to acknowledge each frame received, it can send one cumulative ACK for several frames.
  • 17. Go-Back-N ARQ, normal operation • The sender keeps track of the outstanding frames and updates the variables and windows as the ACKs arrive.
  • 18. Go-Back-N ARQ, lost frame • Frame 2 is lost • When the receiver receives frame 3, it discards frame 3 as it is expecting frame 2 (according to window). • After the timer for frame 2 expires at the sender site, the sender sends frame 2 and 3. (go back to 2)
  • 19. Go-Back-N ARQ, damaged/lost/delayed ACK • If an ACK is damaged/lost, we can have two situations: • If the next ACK arrives before the expiration of any timer, there is no need for retransmission of frames because ACKs are cumulative in this protocol. • If ACK1, ACK2, and ACk3 are lost, ACK4 covers them if it arrives before the timer expires. • If ACK4 arrives after time-out, the last frame and all the frames after that are resent. • Receiver never resends an ACK. • A delayed ACK also triggers the resending of frames
  • 20. Go-Back-N ARQ, sender window size • Size of the sender window must be less than 2 m . Size of the receiver is always 1. If m = 2, window size = 2 m – 1 = 3. • Fig compares a window size of 3 and 4. Accepts as the 1st frame in the next cycle-an error
  • 21. Selective Repeat ARQ, sender and receiver windows • Go-Back-N ARQ simplifies the process at the receiver site. Receiver only keeps track of only one variable, and there is no need to buffer out-of-order frames, they are simply discarded. • However, Go-Back-N ARQ protocol is inefficient for noisy link. It bandwidth inefficient and slows down the transmission. • In Selective Repeat ARQ, only the damaged frame is resent. More bandwidth efficient but more complex processing at receiver. • It defines a negative ACK (NAK) to report the sequence number of a damaged frame before the timer expires.
  • 22. Selective Repeat ARQ, lost frame • Frames 0 and 1 are accepted when received because they are in the range specified by the receiver window. Same for frame 3. • Receiver sends a NAK2 to show that frame 2 has not been received and then sender resends only frame 2 and it is accepted as it is in the range of the window.