SlideShare a Scribd company logo
1 of 17
Seminar on
Flow and Error Control
by:
Manish Tadhiyal
Contents
• Flow Control
• Error Control
• Error and Flow Control Mechanisms
• Stop and Wait
• Stop and Wait ARQ
• Stop and Wait delay
• Piggybacking
• Go-back-N ARQ
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 ACK 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, …
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)
THANK YOU

More Related Content

What's hot

Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layerNaiyan Noor
 
QOS (Quality of Services) - Computer Networks
 QOS (Quality of Services) - Computer Networks QOS (Quality of Services) - Computer Networks
QOS (Quality of Services) - Computer NetworksIIIT Manipur
 
Selective repeat protocol
Selective repeat protocolSelective repeat protocol
Selective repeat protocolManusha Dilan
 
IEEE standards 802.3.&802.11
IEEE standards 802.3.&802.11IEEE standards 802.3.&802.11
IEEE standards 802.3.&802.11Keshav Maheshwari
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control anuragjagetiya
 
RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION           RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION AMOGHA A K
 
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
 
Unit 2 data link control
Unit 2 data link controlUnit 2 data link control
Unit 2 data link controlVishal kakade
 
Token Ring : 802.5
Token Ring : 802.5Token Ring : 802.5
Token Ring : 802.5Pnkj_Sharma
 
Go back-n protocol
Go back-n protocolGo back-n protocol
Go back-n protocolSTEFFY D
 
Multiple Access Protocal
Multiple Access ProtocalMultiple Access Protocal
Multiple Access Protocaltes31
 
Flow control and error control
Flow control and error controlFlow control and error control
Flow control and error controlBHUVIJAYAVELU
 

What's hot (20)

Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
 
Multiple access protocol
Multiple access protocolMultiple access protocol
Multiple access protocol
 
Error control
Error controlError control
Error control
 
QOS (Quality of Services) - Computer Networks
 QOS (Quality of Services) - Computer Networks QOS (Quality of Services) - Computer Networks
QOS (Quality of Services) - Computer Networks
 
Stop-and-Wait ARQ Protocol
Stop-and-Wait ARQ ProtocolStop-and-Wait ARQ Protocol
Stop-and-Wait ARQ Protocol
 
Selective repeat protocol
Selective repeat protocolSelective repeat protocol
Selective repeat protocol
 
IEEE standards 802.3.&802.11
IEEE standards 802.3.&802.11IEEE standards 802.3.&802.11
IEEE standards 802.3.&802.11
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control
 
RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION           RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION
 
Csma cd and csma-ca
Csma cd and csma-caCsma cd and csma-ca
Csma cd and csma-ca
 
Delay , Loss & Throughput
Delay , Loss & ThroughputDelay , Loss & Throughput
Delay , Loss & Throughput
 
HDLC(High level Data Link Control)
HDLC(High level Data Link Control)HDLC(High level Data Link Control)
HDLC(High level Data Link Control)
 
Unit 2 data link control
Unit 2 data link controlUnit 2 data link control
Unit 2 data link control
 
Data link layer
Data link layer Data link layer
Data link layer
 
Token Ring : 802.5
Token Ring : 802.5Token Ring : 802.5
Token Ring : 802.5
 
Go back-n protocol
Go back-n protocolGo back-n protocol
Go back-n protocol
 
Framing in data link layer
Framing in data link layerFraming in data link layer
Framing in data link layer
 
Multiple Access Protocal
Multiple Access ProtocalMultiple Access Protocal
Multiple Access Protocal
 
Media Access Control
Media Access ControlMedia Access Control
Media Access Control
 
Flow control and error control
Flow control and error controlFlow control and error control
Flow control and error control
 

Similar to Flow control & error control

8th lec flow and error control
8th lec   flow and error control8th lec   flow and error control
8th lec flow and error controlInocentshuja Ahmad
 
Computer network slides for easy prepration
Computer network slides for easy preprationComputer network slides for easy prepration
Computer network slides for easy preprationmqasimsheikh5
 
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
 
Data Link Control Protocols
Data Link Control ProtocolsData Link Control Protocols
Data Link Control ProtocolsTechiNerd
 
Unit IV_Flow.pptx
Unit IV_Flow.pptxUnit IV_Flow.pptx
Unit IV_Flow.pptxTejasRao8
 
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
 
Data Link Control.ppt
Data Link Control.pptData Link Control.ppt
Data Link Control.pptTeshome48
 
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 layer elementry protocols
Data link layer elementry protocolsData link layer elementry protocols
Data link layer elementry protocolssabitha sairam
 
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
 
14 data link control
14 data link control14 data link control
14 data link controlarvindsarja
 

Similar to Flow control & error control (20)

8th lec flow and error control
8th lec   flow and error control8th lec   flow and error control
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 prepration
 
Flow control main
Flow control mainFlow control main
Flow control main
 
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...
 
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
 
Flow Control.pptx
Flow Control.pptxFlow Control.pptx
Flow Control.pptx
 
Data Link Control Protocols
Data Link Control ProtocolsData Link Control Protocols
Data Link Control Protocols
 
Go back.pptx
Go back.pptxGo back.pptx
Go back.pptx
 
Unit IV_Flow.pptx
Unit IV_Flow.pptxUnit IV_Flow.pptx
Unit IV_Flow.pptx
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
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
 
Protocols
ProtocolsProtocols
Protocols
 
Data Link Control.ppt
Data Link Control.pptData Link Control.ppt
Data Link Control.ppt
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
 
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 LAYER.pdf
DATA LINK LAYER.pdfDATA LINK LAYER.pdf
DATA LINK LAYER.pdf
 
Presentation on dll
Presentation on dllPresentation on dll
Presentation on dll
 
Data link layer elementry protocols
Data link layer elementry protocolsData link layer elementry protocols
Data link layer elementry protocols
 
Different protocols for data communication networks
Different protocols for data communication networks Different protocols for data communication networks
Different protocols for data communication networks
 
14 data link control
14 data link control14 data link control
14 data link control
 

Recently uploaded

pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 

Flow control & error control

  • 1. Seminar on Flow and Error Control by: Manish Tadhiyal
  • 2. Contents • Flow Control • Error Control • Error and Flow Control Mechanisms • Stop and Wait • Stop and Wait ARQ • Stop and Wait delay • Piggybacking • Go-back-N ARQ
  • 3. 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.
  • 4. 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.
  • 5. Error and Flow Control Mechanisms • Stop-and-Wait • Go-Back-N ARQ • Selective-Repeat ARQ
  • 6. 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
  • 7. Stop-and-Wait ARQ, lost ACK 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.
  • 8. 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.
  • 9. 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.
  • 10. 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.
  • 11. 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
  • 12. 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.
  • 13. 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, …
  • 14. 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.
  • 15. Go-Back-N ARQ, normal operation • The sender keeps track of the outstanding frames and updates the variables and windows as the ACKs arrive.
  • 16. 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)