SlideShare a Scribd company logo
RELIABLE TRANSMISSION
RELIABLE TRANSMISSION
Concept of data flow between sender and receiver
using OSI Model
RELIABLE TRANSMISSION
Sender Side:
Network Layer (N/L) waits for an EVENT
 EVENT : (Request To Send) the data is made by sender
 When sender wants to send data
 Network Layer Gets Data from upper Layers
Data-Link Layer packages the data and Makes Frame
Physical Layer Sends Frame in form of signal
Receiver Side:
Physical Layer waits for an EVENT
 EVENT :(Arrival Notification) of frame is made to Data-Link Layer
 When the frame arrives at the receiver
 Physical layer Receives Frame
Data-Link Layer Extracts Data from the frame and Delivers Data
to Network Layer
Network
Data Link
Physical
Network
Data Link
Physical
Waiting for EVENT
Request To Send
Sender wants to send data
Gets Data
Sends Frame in signal form
Get Data( ) Make Frame ( ) Send Frame( )
Waiting for EVENT
Makes Frame
Arrival Notification
Frame arrives at receiver
Receives Frame
Extracts Data
Delivers Data
Receive Frame( ) Extract Data ( )
Deliver
Data( )
while(true)
{
 WaitForEvent( )
 If Event( RequestToSend( ) )
 {
 Get Data ( )
 Make Frame( )
 Send Frame( )
 }
}
while(true)
{
 WaitForEvent( )
 If Event( ArrivalNotification( ) )
 {
 Receive Frame ( )
 Extract Data( )
 Deliver Data( )
 }
}
Request To Send
Network
Data Link
Physical Arrival Notification
Physical
Data Link
Network
RELIABLE TRANSMISSION
When an error is introduced into the frames and they get
corrupted.
We can use some Error Correction Scheme (ECS) to correct
them
But ECS produce a very large overhead
Or even some errors are to severe to be corrected by ECS
So ultimately we need to discard the frames
We need some strategy to RECOVER these discarded frames
Flow Control: Sender needs to make sure that it is not
sending “more data” then the capacity of receiver
RELIABLE TRANSMISSION
Every strategy used for recovering frames involves two common
concepts
Acknowledgement (Ack)
Whenever frame arrives at the receiver and it is not corrupted
 Receiver sends a control frame back to sender for confirmation purpose
 This control frame is called Acknowledgement (Ack) frame
Timeout
Whenever sender transmits a frame it then waits for the
acknowledgement by starting a timer
This waiting time is usually equal to Round Trip Time (RTT)
If the acknowledgement does not come back with in waiting time,
an EVENT occurs called “Timeout”
 When “Timeout” event occurs sender retransmits the frame
RELIABLE TRANSMISSION
The general strategy to implement Acknowledgements &
Timeout is sometimes called
ARQ ( Automatic Repeat Request )
We will study the following ARQ Algorithms
Stop-And-Wait ARQ
Go-Back-N ARQ
Selective Repeat ARQ
Stop-And-Wait ARQ
Stop-And-Wait ARQ
The simplest ARQ scheme is the stop-and-wait algorithm
 After transmitting one frame, the Sender
 Starts the timer and STOPS the transmission
 WAITS for an acknowledgment until the timer expires
 If the acknowledgement comes back before the expiration
of timer only then next frame is transmitted
 If the acknowledgment does not arrive before the
expiration of timer
 the sender times out and retransmits the original frame.
Stop-And-Wait ARQ
Stop-And-Wait ARQ
 Problem: Receiver has duplicate frames
Stop-And-Wait ARQ
So apart from corrupted frames RECEIVER may also face
problems of Duplicated frames and Out-Of-Order frames (Lost
frames)
A corrupted frame can be detected by an error detection
strategy
For detecting Duplicated frames and Lost frames
Every fame is given a special number called
SEQUENCE NUMBER
If two received frames have same sequence number, it
indicates that frames are duplicated
If two frames come out of order, it means that a frame in
between may have been lost
Stop-And-Wait ARQ
Like data frames acknowledgements are also given Sequence
Numbers (or Acknowledgement Number)
The Acknowledgement Number is actually the sequence number
of next Expected Frame i.e.
 Ack_No:= Seq_No + 1
So when a receiver accepts a Data Frame with Seq_No:=3
 Receiver sends an acknowledgement back to sender with Ack_No:=4
 When sender receives the Acknowledgement with Ack_No:=4,
 This tells the sender that receiver has received the frame with Seq_No:=3
 And now it is expecting the next frame with Seq_No:=4
Stop-And-Wait ARQ
How many frames can be counted by the Sequence Number?
If M bits are used for the sequence number
It can count 2M frames
Where the count begins from zero and goes up to 2M - 1
If there are more then 2M frames, the counting is again repeated
from 0 to 2m - 1
For example if 3 bits are used for the sequence number
It can count 23 frames, i.e. 8 frames
Where the count goes from 0 to 7
If there are 8th, 9th and 10th frames, they will be numbered 0, 1 and 2
The size of sequence number field should be chosen to
minimize the size of frames
Stop-And-Wait ARQ
For the sake of Stop-and-Wait ARQ, there can only be at
most two frames on the communication line
Data Frame and Acknowledgement Frame
So one bit is enough to count the frame and
acknowledgement, i.e. using one bit possible values = 0, 1
The 4 frames will be counted like this: 0, 1, 0, 1
Now if sender sends a frame with Seq_No:= 0
The Receiver will send an Acknowledgement with
Ack_No:=1
Stop-And-Wait ARQ
Data
Frame Sn = 0
Event
canSend
Sequence Number
True
Sn = 0
RequestToSend
Frame Sn = 0
Sn = 1
False
Frame Ackn = 1
Arrival Notification
True
Data
Frame Sn = 0
Event
canSend
Sequence Number
True
Sn = 0
RequestToSend
Frame Sn = 0
Sn = 1
False
Arrival NotificationEvent TimeOut ( )
Frame Sn = 0
SN = 0;
canSend = True;
While ( true ) {
 WaitForEvent( );
 If Event( RequestToSend( ) And canSend = True ) {
 Get Data ( );
 Make Frame ( SN );
 Store Frame ( SN );
 Send Frame ( SN );
 Start Timer ( );
 SN = ( SN + 1 ) % 2
 canSend = False;
}
WaitForEvent ( );
If Event( Arrival Notification( ) ) {
Receive Frame ( AckN );
 If ( (Not Corrupted) And AckN = SN )
{
 Stop Timer ( );
 Purge Frame ( SN - 1 );
 canSend = True;
}
}
If Event( Time Out( ) ) {
Start Timer( );
Resend Frame( SN - 1 );
}
}
Stop-And-Wait ARQ
Event
Sequence Number
Frame Sn = 0
Rn = 0
Arrival Notification
Event
Sequence Number
Frame Sn = 0
Rn = 0
Arrival Notification
Rn = 1
Frame Ackn = 1
Data
Frame Sn = 0
RN = 0;
While ( true ) {
 WaitForEvent( );
 If Event( Arrival Notification ) {
 Receive Frame ( );
 If ( Frame is Corrupted )
 Sleep ( );
 If ( Sn = Rn ) {
 Extract Data ( );
 Deliver Data ( );
 Rn = (Rn + 1) mod 2
 }
 Send Acknowledgement ( Rn );
}
}
Stop-And-Wait ARQ
Drawback: Wastage of bandwidth.
At a given time there can only be One Frame on the
communication line
Stop and Wait ARQ
Go-Back-N ARQ
In this protocol we can send multiple frames without receiving
acknowledgement
This protocol uses a logical concept called:
SLIDING WINDOW
 Collection of frames that can be transmitted without receiving
acknowledgement
 Unacknowledged frames which are transmitted i.e. the frames
present in the window are called Outstanding frames
This protocol also uses the concept of:
CUMULATIVE ACKNOWLEDGEMENT
 A single acknowledgement frame which acknowledges multiple
frames
A single timer can run for all the frames
Or separate timers can run for every frame
Go-Back-N ARQ
A window is divided into three parts
Frames that have
already been
acknowledged,
sender ignores
these frames
completely
SENDER WINDOW
Outstanding frames
with unknown status,
i.e. their
acknowledgement
has not yet arrived
(actual window)
Frames that cannot be
transmitted. Every
time ACK of
outstanding frame
arrives, the window
slides to right
0 1 2 3 4 5 6 7 8 9 10 11
Receiver window
contains only one frame
Go-Back-N ARQ
Procedure:
Suppose the sender window size is 3 frames
Sender transmits frame 0,1 and 2 without waiting for
acknowledgement
After transmitting frame 0, it immediately starts the timer
Receiver sends an acknowledgement for every frame
Every time acknowledgment arrives,
 Sender window slides to the right, meaning one more frame enters the
window and the Acknowledged Frame exits the window
If the acknowledgment does not come, the sender goes back to the
beginning of window and retransmits all frames
Hence the name Go-Back-N ARQ
0 1 2 3 4 5
Sender Window = 3 FRAMES
F0
F1
F2
A1
A2
A3
TIMEOUT
0
F3
F4
F5
A4
A5
A6
TIMEOUT
1 2 3 4 5
SENDER RECEIVER SENDER RECEIVER
Cumulative Acknowledgement
F0
F1
F2
A1
A2
A3
TIMEOUT
SENDER RECEIVER
F3
A4
Acknowledgment 4 arrives
before timeout
So in this case Ack-4 is the
Accumulative
Acknowledgement
Ack-4 will be accepted as
the acknowledgement for F3,
F2 and F1
F0
F1
F2
TIMEOUT
SENDER RECEIVER
F3
A1
Go-Back-N ARQ F2 arrives at the receiver
Where receiver is expecting F1
An out-of-order frame
So receiver discards it
And also the frame after it
Ultimately timer times out
Sender goes back to the
beginning of window (i.e. F1)
Retransmits all the frames
Go-Back-N ARQ
Size of Window:
How many frames can be sent without receiving
acknowledgement? Or in other words
How many frames can be outstanding?
We know that m bits can count 2m frames
But
Go-Back-N ARQ
If
m bits are used for sequence
number field then:
size of window <= 2m – 1
Go-Back-N ARQ
If m bits
are used for sequence number field
then:
size of window <= 2m – 1
If We break this rule, receiver cannot
detect duplicate frames, i.e. if keep
the window size = 2m
Go-Back-N ARQ
Suppose m is 3 bits so it can count 2m = 23 = 8 frames
Frames are numbered as 0,1,2,3,4,5,6,7
The size of window should be 2m – 1 = 23 – 1 = 7
Now instead of 7 we choose window size = 23 = 8
Entire window is transmitted i.e. frames from 0,1,….7
 All Frames were received correctly but their acknowledgements were lost
Next expected frame by the receiver is frame-0.
Sender retransmits frame-0 but this is not the new frame, it’s
the duplicate of first frame in window
But sender mistakenly accepts this frame as the new frame
instead of discarding it
Go-Back-N ARQ
Suppose m is 3 bits so it can count 2m = 23 = 8 frames
Frames are numbered as 0,1,2,3,4,5,6,7
This time we choose size of window = 2m – 1 = 7
Entire window is transmitted i.e. frames from 0,1,….6
All Frames were received correctly but their acknowledgements
were lost
Next expected frame by the receiver is frame-7
Sender retransmits frame-0
Since receiver has already received frame-0 and is expecting
frame-7
So receiver detects the duplicate frame and rightfully discards it
Go-Back-N ARQ
Event
Sender Window Size
Seq_No of First
Outstanding Frame
SW = 2
SF = 0
RequestToSend
Seq_No of Next Frame to
be transmitted
SN = 0
DataFrame Sn = 0
Frame Sn = 0
SN = 1
Frame Sn = 1
Frame Sn = 1
SN = 2
 SW = 2m – 1
 SF = 0
 SN = 0
 While ( true ) {
 WaitForEvent( );
 If Event ( RequestToSend )
{
If ( SN – SF >= SW )
Sleep ( )
Get Data ( );
Make Frame ( SN );
Store Frame ( SN );
Send Frame ( SN );
SN = SN + 1
If ( Timer Not Running )
Start Timer( )
 }
Frame Ackn = 1
Sender Window Size
Seq_No of First
Outstanding Frame
SW = 2
SF = 0
Seq_No of Next Frame to
be transmitted
SN = 0SN = 1SN = 2
Frame Sn = 0
Frame Sn = 1
Event
Arrival Notification
Frame Sn = 0
Frame Sn = 1
SF = 1
If Event( Arrival Notification( ) )
{
Receive Frame ( AckN );
If ( Corrupted Acknowledgement )
Sleep ( );
If ( Ack No > SF and Ack No <= SN )
While ( SF < Ack No )
{
Purge Frame(SF )
SF = SF + 1
}
Stop Timer ( )
}
Sender Window Size
Seq_No of First
Outstanding Frame
SW = 2
SF = 0
Seq_No of Next Frame to
be transmitted
SN = 0SN = 1SN = 2
Frame Sn = 0
Frame Sn = 1
Event
Time Out
Frame Sn = 0
Frame Sn = 1
Temp = 0Temp = 1Temp = 2
If Event( Time Out ) {
Start Timer( );
Temp = SF
While ( Temp < SN )
{
Send Frame( Temp )
Temp = Temp + 1
}
}
}
Go-Back-N ARQ
Event
Sequence Number
Frame Sn = 0
Rn = 0
Arrival Notification
Event
Sequence Number
Frame Sn = 0
Rn = 0
Arrival Notification
Rn = 1
Frame Ackn = 1
Data
Frame Sn = 0
 RN = 0;
 While ( true ) {
 WaitForEvent( );
 If Event( Arrival Notification ) {
Receive Frame ( );
If ( Frame is Corrupted )
Sleep ( );
If ( Sn = Rn ) {
Extract Data ( );
Deliver Data ( );
Rn = Rn + 1
}
Send Acknowledgement ( Rn );
}
 }
Selective Repeat ARQ
 Assignment

More Related Content

What's hot

Sequential consistency model
Sequential consistency modelSequential consistency model
Sequential consistency model
Bharathi Lakshmi Pon
 
Grayhole
GrayholeGrayhole
Grayhole
Kumud Dixit
 
Lecture 15
Lecture 15Lecture 15
Lecture 15
Joe Christensen
 
MAC
MACMAC
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPTEC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
babuece
 
Quality of Service
Quality  of  ServiceQuality  of  Service
Quality of Service
S. M. Shakib Limon
 
Mobile Transport layer
Mobile Transport layerMobile Transport layer
Mobile Transport layer
Pallepati Vasavi
 
ALOHA Protocol (in detail)
ALOHA Protocol (in detail)ALOHA Protocol (in detail)
ALOHA Protocol (in detail)
Hinal Lunagariya
 
MEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROLMEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROL
junnubabu
 
Congestion control, slow start, fast retransmit
Congestion control, slow start, fast retransmit   Congestion control, slow start, fast retransmit
Congestion control, slow start, fast retransmit
rajisri2
 
Source coding
Source coding Source coding
Source coding
Shankar Gangaju
 
Routing protocols
Routing protocolsRouting protocols
Routing protocols
N.Jagadish Kumar
 
Secure shell ppt
Secure shell pptSecure shell ppt
Secure shell ppt
sravya raju
 
Pretty good privacy
Pretty good privacyPretty good privacy
Pretty good privacy
Punnya Babu
 
IEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and ServicesIEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and Services
Sayed Chhattan Shah
 
Analog and Digital Communication
Analog and Digital CommunicationAnalog and Digital Communication
Analog and Digital Communication
BHAVYA DOSHI
 
The Heartbleed Attack
The Heartbleed AttackThe Heartbleed Attack
The Heartbleed Attack
Shreyas Kothari
 
Congestion control
Congestion controlCongestion control
Congestion control
Nithin Raj
 
Web and http computer network
Web and http computer networkWeb and http computer network
Web and http computer network
Anil Pokhrel
 
Data link layer
Data link layerData link layer
Data link layer
Monu Chaudhary
 

What's hot (20)

Sequential consistency model
Sequential consistency modelSequential consistency model
Sequential consistency model
 
Grayhole
GrayholeGrayhole
Grayhole
 
Lecture 15
Lecture 15Lecture 15
Lecture 15
 
MAC
MACMAC
MAC
 
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPTEC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
EC 6802 WIRELESS NETWORK_ BABU M_ unit 3 ,4 & 5 PPT
 
Quality of Service
Quality  of  ServiceQuality  of  Service
Quality of Service
 
Mobile Transport layer
Mobile Transport layerMobile Transport layer
Mobile Transport layer
 
ALOHA Protocol (in detail)
ALOHA Protocol (in detail)ALOHA Protocol (in detail)
ALOHA Protocol (in detail)
 
MEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROLMEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROL
 
Congestion control, slow start, fast retransmit
Congestion control, slow start, fast retransmit   Congestion control, slow start, fast retransmit
Congestion control, slow start, fast retransmit
 
Source coding
Source coding Source coding
Source coding
 
Routing protocols
Routing protocolsRouting protocols
Routing protocols
 
Secure shell ppt
Secure shell pptSecure shell ppt
Secure shell ppt
 
Pretty good privacy
Pretty good privacyPretty good privacy
Pretty good privacy
 
IEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and ServicesIEEE 802.11 Architecture and Services
IEEE 802.11 Architecture and Services
 
Analog and Digital Communication
Analog and Digital CommunicationAnalog and Digital Communication
Analog and Digital Communication
 
The Heartbleed Attack
The Heartbleed AttackThe Heartbleed Attack
The Heartbleed Attack
 
Congestion control
Congestion controlCongestion control
Congestion control
 
Web and http computer network
Web and http computer networkWeb and http computer network
Web and http computer network
 
Data link layer
Data link layerData link layer
Data link layer
 

Viewers also liked

Ch 20
Ch 20Ch 20
Ch 27
Ch 27Ch 27
Ch 31
Ch 31Ch 31
Ch 24
Ch 24Ch 24
Ch 28
Ch 28Ch 28
Ch 29
Ch 29Ch 29
Ch 16
Ch 16Ch 16
Ch 07
Ch 07Ch 07
Ch 12
Ch 12Ch 12
Ch 23
Ch 23Ch 23
Ch 18
Ch 18Ch 18
Ch14
Ch14Ch14
Ch 26
Ch 26Ch 26
Ch 30
Ch 30Ch 30
Ch 14
Ch 14Ch 14
Ch 25
Ch 25Ch 25
Ch 02
Ch 02Ch 02
Ch 19
Ch 19Ch 19
Ch 13
Ch 13Ch 13
Ch 15
Ch 15Ch 15

Viewers also liked (20)

Ch 20
Ch 20Ch 20
Ch 20
 
Ch 27
Ch 27Ch 27
Ch 27
 
Ch 31
Ch 31Ch 31
Ch 31
 
Ch 24
Ch 24Ch 24
Ch 24
 
Ch 28
Ch 28Ch 28
Ch 28
 
Ch 29
Ch 29Ch 29
Ch 29
 
Ch 16
Ch 16Ch 16
Ch 16
 
Ch 07
Ch 07Ch 07
Ch 07
 
Ch 12
Ch 12Ch 12
Ch 12
 
Ch 23
Ch 23Ch 23
Ch 23
 
Ch 18
Ch 18Ch 18
Ch 18
 
Ch14
Ch14Ch14
Ch14
 
Ch 26
Ch 26Ch 26
Ch 26
 
Ch 30
Ch 30Ch 30
Ch 30
 
Ch 14
Ch 14Ch 14
Ch 14
 
Ch 25
Ch 25Ch 25
Ch 25
 
Ch 02
Ch 02Ch 02
Ch 02
 
Ch 19
Ch 19Ch 19
Ch 19
 
Ch 13
Ch 13Ch 13
Ch 13
 
Ch 15
Ch 15Ch 15
Ch 15
 

Similar to Reliablt transmission

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
nanisrikar276711
 
Flow Control
Flow ControlFlow Control
Flow Control
selvakumar_b1985
 
Presentation on dll
Presentation on dllPresentation on dll
Presentation on dll
Alisha Korpal
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
fitnessbd
 
Flowctrl
FlowctrlFlowctrl
Flowctrl
samathana prabu
 
Flow Control (1).ppt
Flow Control (1).pptFlow Control (1).ppt
Flow Control (1).ppt
sarthakgithub
 
6 data linkcontrol
6  data linkcontrol6  data linkcontrol
6 data linkcontrol
Hattori Sidek
 
PROTOCOL ICT.pptx
PROTOCOL ICT.pptxPROTOCOL ICT.pptx
PROTOCOL ICT.pptx
Aditya101713
 
document.pdf
document.pdfdocument.pdf
document.pdf
skmohiddin
 
Micro project on ARQ
Micro project on ARQMicro project on ARQ
Micro project on ARQ
Faizaan Ahmed Khan
 
Arq protocol part 2
Arq protocol part 2Arq protocol part 2
Arq protocol part 2
Aanandha Saravanan
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Control
tameemyousaf
 
Unit 2_ Flow & Error Control in computer networks
Unit 2_ Flow & Error Control in computer networksUnit 2_ Flow & Error Control in computer networks
Unit 2_ Flow & Error Control in computer networks
Balasubramanian699229
 
Unit IV_Flow.pptx
Unit IV_Flow.pptxUnit IV_Flow.pptx
Unit IV_Flow.pptx
TejasRao8
 
Sliding window and error control
Sliding window and error controlSliding window and error control
Sliding window and error control
Adil Mehmoood
 
Data link layer (Unit 2).pdf
Data link layer (Unit 2).pdfData link layer (Unit 2).pdf
Data link layer (Unit 2).pdf
BharatiPatelPhDStude
 
Flow Control and Error Control
Flow Control and Error ControlFlow Control and Error Control
Flow Control and Error Control
Minhazul Abedin Munna
 
09 Data Link LayerFlow Control.ppt
09 Data Link LayerFlow Control.ppt09 Data Link LayerFlow Control.ppt
09 Data Link LayerFlow Control.ppt
ShaliniKumariGupta1
 
stop and wait
stop and waitstop and wait
stop and wait
swati463221
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
Sehrish Rafiq
 

Similar to Reliablt transmission (20)

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
Flow ControlFlow Control
Flow Control
 
Presentation on dll
Presentation on dllPresentation on dll
Presentation on dll
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
Flowctrl
FlowctrlFlowctrl
Flowctrl
 
Flow Control (1).ppt
Flow Control (1).pptFlow Control (1).ppt
Flow Control (1).ppt
 
6 data linkcontrol
6  data linkcontrol6  data linkcontrol
6 data linkcontrol
 
PROTOCOL ICT.pptx
PROTOCOL ICT.pptxPROTOCOL ICT.pptx
PROTOCOL ICT.pptx
 
document.pdf
document.pdfdocument.pdf
document.pdf
 
Micro project on ARQ
Micro project on ARQMicro project on ARQ
Micro project on ARQ
 
Arq protocol part 2
Arq protocol part 2Arq protocol part 2
Arq protocol part 2
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Control
 
Unit 2_ Flow & Error Control in computer networks
Unit 2_ Flow & Error Control in computer networksUnit 2_ Flow & Error Control in computer networks
Unit 2_ Flow & Error Control in computer networks
 
Unit IV_Flow.pptx
Unit IV_Flow.pptxUnit IV_Flow.pptx
Unit IV_Flow.pptx
 
Sliding window and error control
Sliding window and error controlSliding window and error control
Sliding window and error control
 
Data link layer (Unit 2).pdf
Data link layer (Unit 2).pdfData link layer (Unit 2).pdf
Data link layer (Unit 2).pdf
 
Flow Control and Error Control
Flow Control and Error ControlFlow Control and Error Control
Flow Control and Error Control
 
09 Data Link LayerFlow Control.ppt
09 Data Link LayerFlow Control.ppt09 Data Link LayerFlow Control.ppt
09 Data Link LayerFlow Control.ppt
 
stop and wait
stop and waitstop and wait
stop and wait
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
 

Recently uploaded

Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
melliereed
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
EduSkills OECD
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
nitinpv4ai
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 

Recently uploaded (20)

Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 

Reliablt transmission

  • 1.
  • 3. RELIABLE TRANSMISSION Concept of data flow between sender and receiver using OSI Model
  • 4. RELIABLE TRANSMISSION Sender Side: Network Layer (N/L) waits for an EVENT  EVENT : (Request To Send) the data is made by sender  When sender wants to send data  Network Layer Gets Data from upper Layers Data-Link Layer packages the data and Makes Frame Physical Layer Sends Frame in form of signal Receiver Side: Physical Layer waits for an EVENT  EVENT :(Arrival Notification) of frame is made to Data-Link Layer  When the frame arrives at the receiver  Physical layer Receives Frame Data-Link Layer Extracts Data from the frame and Delivers Data to Network Layer
  • 5. Network Data Link Physical Network Data Link Physical Waiting for EVENT Request To Send Sender wants to send data Gets Data Sends Frame in signal form Get Data( ) Make Frame ( ) Send Frame( ) Waiting for EVENT Makes Frame Arrival Notification Frame arrives at receiver Receives Frame Extracts Data Delivers Data Receive Frame( ) Extract Data ( ) Deliver Data( )
  • 6. while(true) {  WaitForEvent( )  If Event( RequestToSend( ) )  {  Get Data ( )  Make Frame( )  Send Frame( )  } } while(true) {  WaitForEvent( )  If Event( ArrivalNotification( ) )  {  Receive Frame ( )  Extract Data( )  Deliver Data( )  } } Request To Send Network Data Link Physical Arrival Notification Physical Data Link Network
  • 7. RELIABLE TRANSMISSION When an error is introduced into the frames and they get corrupted. We can use some Error Correction Scheme (ECS) to correct them But ECS produce a very large overhead Or even some errors are to severe to be corrected by ECS So ultimately we need to discard the frames We need some strategy to RECOVER these discarded frames Flow Control: Sender needs to make sure that it is not sending “more data” then the capacity of receiver
  • 8. RELIABLE TRANSMISSION Every strategy used for recovering frames involves two common concepts Acknowledgement (Ack) Whenever frame arrives at the receiver and it is not corrupted  Receiver sends a control frame back to sender for confirmation purpose  This control frame is called Acknowledgement (Ack) frame Timeout Whenever sender transmits a frame it then waits for the acknowledgement by starting a timer This waiting time is usually equal to Round Trip Time (RTT) If the acknowledgement does not come back with in waiting time, an EVENT occurs called “Timeout”  When “Timeout” event occurs sender retransmits the frame
  • 9. RELIABLE TRANSMISSION The general strategy to implement Acknowledgements & Timeout is sometimes called ARQ ( Automatic Repeat Request ) We will study the following ARQ Algorithms Stop-And-Wait ARQ Go-Back-N ARQ Selective Repeat ARQ
  • 10. Stop-And-Wait ARQ Stop-And-Wait ARQ The simplest ARQ scheme is the stop-and-wait algorithm  After transmitting one frame, the Sender  Starts the timer and STOPS the transmission  WAITS for an acknowledgment until the timer expires  If the acknowledgement comes back before the expiration of timer only then next frame is transmitted  If the acknowledgment does not arrive before the expiration of timer  the sender times out and retransmits the original frame.
  • 12. Stop-And-Wait ARQ  Problem: Receiver has duplicate frames
  • 13. Stop-And-Wait ARQ So apart from corrupted frames RECEIVER may also face problems of Duplicated frames and Out-Of-Order frames (Lost frames) A corrupted frame can be detected by an error detection strategy For detecting Duplicated frames and Lost frames Every fame is given a special number called SEQUENCE NUMBER If two received frames have same sequence number, it indicates that frames are duplicated If two frames come out of order, it means that a frame in between may have been lost
  • 14. Stop-And-Wait ARQ Like data frames acknowledgements are also given Sequence Numbers (or Acknowledgement Number) The Acknowledgement Number is actually the sequence number of next Expected Frame i.e.  Ack_No:= Seq_No + 1 So when a receiver accepts a Data Frame with Seq_No:=3  Receiver sends an acknowledgement back to sender with Ack_No:=4  When sender receives the Acknowledgement with Ack_No:=4,  This tells the sender that receiver has received the frame with Seq_No:=3  And now it is expecting the next frame with Seq_No:=4
  • 15. Stop-And-Wait ARQ How many frames can be counted by the Sequence Number? If M bits are used for the sequence number It can count 2M frames Where the count begins from zero and goes up to 2M - 1 If there are more then 2M frames, the counting is again repeated from 0 to 2m - 1 For example if 3 bits are used for the sequence number It can count 23 frames, i.e. 8 frames Where the count goes from 0 to 7 If there are 8th, 9th and 10th frames, they will be numbered 0, 1 and 2 The size of sequence number field should be chosen to minimize the size of frames
  • 16. Stop-And-Wait ARQ For the sake of Stop-and-Wait ARQ, there can only be at most two frames on the communication line Data Frame and Acknowledgement Frame So one bit is enough to count the frame and acknowledgement, i.e. using one bit possible values = 0, 1 The 4 frames will be counted like this: 0, 1, 0, 1 Now if sender sends a frame with Seq_No:= 0 The Receiver will send an Acknowledgement with Ack_No:=1
  • 18. Data Frame Sn = 0 Event canSend Sequence Number True Sn = 0 RequestToSend Frame Sn = 0 Sn = 1 False Frame Ackn = 1 Arrival Notification True
  • 19. Data Frame Sn = 0 Event canSend Sequence Number True Sn = 0 RequestToSend Frame Sn = 0 Sn = 1 False Arrival NotificationEvent TimeOut ( ) Frame Sn = 0
  • 20. SN = 0; canSend = True; While ( true ) {  WaitForEvent( );  If Event( RequestToSend( ) And canSend = True ) {  Get Data ( );  Make Frame ( SN );  Store Frame ( SN );  Send Frame ( SN );  Start Timer ( );  SN = ( SN + 1 ) % 2  canSend = False; }
  • 21. WaitForEvent ( ); If Event( Arrival Notification( ) ) { Receive Frame ( AckN );  If ( (Not Corrupted) And AckN = SN ) {  Stop Timer ( );  Purge Frame ( SN - 1 );  canSend = True; } }
  • 22. If Event( Time Out( ) ) { Start Timer( ); Resend Frame( SN - 1 ); } }
  • 24. Event Sequence Number Frame Sn = 0 Rn = 0 Arrival Notification
  • 25. Event Sequence Number Frame Sn = 0 Rn = 0 Arrival Notification Rn = 1 Frame Ackn = 1 Data Frame Sn = 0
  • 26. RN = 0; While ( true ) {  WaitForEvent( );  If Event( Arrival Notification ) {  Receive Frame ( );  If ( Frame is Corrupted )  Sleep ( );  If ( Sn = Rn ) {  Extract Data ( );  Deliver Data ( );  Rn = (Rn + 1) mod 2  }  Send Acknowledgement ( Rn ); } }
  • 27. Stop-And-Wait ARQ Drawback: Wastage of bandwidth. At a given time there can only be One Frame on the communication line Stop and Wait ARQ
  • 28. Go-Back-N ARQ In this protocol we can send multiple frames without receiving acknowledgement This protocol uses a logical concept called: SLIDING WINDOW  Collection of frames that can be transmitted without receiving acknowledgement  Unacknowledged frames which are transmitted i.e. the frames present in the window are called Outstanding frames This protocol also uses the concept of: CUMULATIVE ACKNOWLEDGEMENT  A single acknowledgement frame which acknowledges multiple frames A single timer can run for all the frames Or separate timers can run for every frame
  • 29. Go-Back-N ARQ A window is divided into three parts Frames that have already been acknowledged, sender ignores these frames completely SENDER WINDOW Outstanding frames with unknown status, i.e. their acknowledgement has not yet arrived (actual window) Frames that cannot be transmitted. Every time ACK of outstanding frame arrives, the window slides to right 0 1 2 3 4 5 6 7 8 9 10 11 Receiver window contains only one frame
  • 30. Go-Back-N ARQ Procedure: Suppose the sender window size is 3 frames Sender transmits frame 0,1 and 2 without waiting for acknowledgement After transmitting frame 0, it immediately starts the timer Receiver sends an acknowledgement for every frame Every time acknowledgment arrives,  Sender window slides to the right, meaning one more frame enters the window and the Acknowledged Frame exits the window If the acknowledgment does not come, the sender goes back to the beginning of window and retransmits all frames Hence the name Go-Back-N ARQ
  • 31. 0 1 2 3 4 5 Sender Window = 3 FRAMES F0 F1 F2 A1 A2 A3 TIMEOUT 0 F3 F4 F5 A4 A5 A6 TIMEOUT 1 2 3 4 5 SENDER RECEIVER SENDER RECEIVER
  • 32. Cumulative Acknowledgement F0 F1 F2 A1 A2 A3 TIMEOUT SENDER RECEIVER F3 A4 Acknowledgment 4 arrives before timeout So in this case Ack-4 is the Accumulative Acknowledgement Ack-4 will be accepted as the acknowledgement for F3, F2 and F1
  • 33. F0 F1 F2 TIMEOUT SENDER RECEIVER F3 A1 Go-Back-N ARQ F2 arrives at the receiver Where receiver is expecting F1 An out-of-order frame So receiver discards it And also the frame after it Ultimately timer times out Sender goes back to the beginning of window (i.e. F1) Retransmits all the frames Go-Back-N ARQ
  • 34. Size of Window: How many frames can be sent without receiving acknowledgement? Or in other words How many frames can be outstanding? We know that m bits can count 2m frames But Go-Back-N ARQ If m bits are used for sequence number field then: size of window <= 2m – 1
  • 35. Go-Back-N ARQ If m bits are used for sequence number field then: size of window <= 2m – 1 If We break this rule, receiver cannot detect duplicate frames, i.e. if keep the window size = 2m
  • 36. Go-Back-N ARQ Suppose m is 3 bits so it can count 2m = 23 = 8 frames Frames are numbered as 0,1,2,3,4,5,6,7 The size of window should be 2m – 1 = 23 – 1 = 7 Now instead of 7 we choose window size = 23 = 8 Entire window is transmitted i.e. frames from 0,1,….7  All Frames were received correctly but their acknowledgements were lost Next expected frame by the receiver is frame-0. Sender retransmits frame-0 but this is not the new frame, it’s the duplicate of first frame in window But sender mistakenly accepts this frame as the new frame instead of discarding it
  • 37. Go-Back-N ARQ Suppose m is 3 bits so it can count 2m = 23 = 8 frames Frames are numbered as 0,1,2,3,4,5,6,7 This time we choose size of window = 2m – 1 = 7 Entire window is transmitted i.e. frames from 0,1,….6 All Frames were received correctly but their acknowledgements were lost Next expected frame by the receiver is frame-7 Sender retransmits frame-0 Since receiver has already received frame-0 and is expecting frame-7 So receiver detects the duplicate frame and rightfully discards it
  • 39. Event Sender Window Size Seq_No of First Outstanding Frame SW = 2 SF = 0 RequestToSend Seq_No of Next Frame to be transmitted SN = 0 DataFrame Sn = 0 Frame Sn = 0 SN = 1 Frame Sn = 1 Frame Sn = 1 SN = 2
  • 40.  SW = 2m – 1  SF = 0  SN = 0  While ( true ) {  WaitForEvent( );  If Event ( RequestToSend ) { If ( SN – SF >= SW ) Sleep ( ) Get Data ( ); Make Frame ( SN ); Store Frame ( SN ); Send Frame ( SN ); SN = SN + 1 If ( Timer Not Running ) Start Timer( )  }
  • 41. Frame Ackn = 1 Sender Window Size Seq_No of First Outstanding Frame SW = 2 SF = 0 Seq_No of Next Frame to be transmitted SN = 0SN = 1SN = 2 Frame Sn = 0 Frame Sn = 1 Event Arrival Notification Frame Sn = 0 Frame Sn = 1 SF = 1
  • 42. If Event( Arrival Notification( ) ) { Receive Frame ( AckN ); If ( Corrupted Acknowledgement ) Sleep ( ); If ( Ack No > SF and Ack No <= SN ) While ( SF < Ack No ) { Purge Frame(SF ) SF = SF + 1 } Stop Timer ( ) }
  • 43. Sender Window Size Seq_No of First Outstanding Frame SW = 2 SF = 0 Seq_No of Next Frame to be transmitted SN = 0SN = 1SN = 2 Frame Sn = 0 Frame Sn = 1 Event Time Out Frame Sn = 0 Frame Sn = 1 Temp = 0Temp = 1Temp = 2
  • 44. If Event( Time Out ) { Start Timer( ); Temp = SF While ( Temp < SN ) { Send Frame( Temp ) Temp = Temp + 1 } } }
  • 46. Event Sequence Number Frame Sn = 0 Rn = 0 Arrival Notification
  • 47. Event Sequence Number Frame Sn = 0 Rn = 0 Arrival Notification Rn = 1 Frame Ackn = 1 Data Frame Sn = 0
  • 48.  RN = 0;  While ( true ) {  WaitForEvent( );  If Event( Arrival Notification ) { Receive Frame ( ); If ( Frame is Corrupted ) Sleep ( ); If ( Sn = Rn ) { Extract Data ( ); Deliver Data ( ); Rn = Rn + 1 } Send Acknowledgement ( Rn ); }  }