SlideShare a Scribd company logo
1 of 55
Part 3
Reliable data transfer over an
unreliable network
© O. Bonaventure, UCLouvain, 2023. Supplementary material for the
Computer Networking : Principles, Protocols and Practice ebook, https://www.computer-networking.info
Agenda
• Reliable data transfer over a reliable network
• How unreliable is the Internet ?
• Reliable data transfer techniques
• The Alternating Bit Protocol
• Go-Back-N
• Selective repeat
How to reliably transfer data ?
• Hypothesis
• Internet is fully reliable
A B
Data.request(a) segment(a)
Data.ind(a)
Data.request(b) segment(b)
Data.ind(b)
Data.request(c) segment(c)
Data.ind(c)
Does this always work ?
Question
• What do we need to add to our “reliable” transfer to allow a
datacenter to send data to an Internet of Things device without
overflow ?
Finite State Machine
• Sender
• Receiver
Control and data segments
A B
Data.req(b) C(OK) Data.ind(a)
D(a)
Data.req(a)
D(b)
Data.ind(b)
C(OK)
Payload
Header Trailer
Round trip time (rtt)
Question
• Two hosts are connected with a 1 Gbps (10^9 bits/sec) network. It
takes one msec to deliver a 1000 bits segment from host A to host B.
What is the bandwidth that this protocol will achieve (in bits per
second) ?
Agenda
• Reliable data transfer over a reliable network
• How unreliable is the Internet ?
• Reliable data transfer techniques
• The Alternating Bit Protocol
• Go-Back-N
• Selective repeat
The network is imperfect
• What can happen to a packet sent over the Internet ?
• Packet reaches destination
• Packet can suffer transmission errors
• Packet contents can be corrupted
• Links have typically Bit Error Rates of 10-8 to 10-11
• Wireless suffers from more errors than cable and fiber
• Packet can be dropped before reaching destination
• Packet can be delayed
Measuring Internet performance
Internet packet losses
What can explain
these packet
loss ratios ?
Based on data extracted by François Michel from measurementlab’s big query
Measuring Internet performance (2)
Internet performance in Wallonia
Broadband access at 30 Mbps or better
Initiative Amélie
Améliorer Internet partout
• Objectif
• L’initiative Amélie vise à mettre sur pied une équipe d’étudiant.e.s bénévoles
afin de proposer un service de diagnostic Internet d’habitations privées.
L’objectif est d’aider les habitants à améliorer la qualité de leur connexion
Internet sans nécessairement changer d’offre ou de fournisseur
• Mise en oeuvre
• Formation à l’analyse des performances en utilisant des outils adaptés et au
diagnostic des facteurs qui réduisent les performances
• Coaching par des chercheurs qui améliorent Internet et des étudiant.e.s de
Master
Agenda
• Reliable data transfer over a reliable network
• How unreliable is the Internet ?
• Reliable data transfer techniques
• The Alternating Bit Protocol
• Go-Back-N
• Selective repeat
How to deal with transmission errors ?
• The receiver must be able to detect that the content of a segment
has been modified
• Checksum, CRC
Question
• How should a host react when it receives a data segment with an
incorrect checksum ?
Coping with errors
A B
Data.req(b) C(OK) Data.ind(a)
D(a)
Data.req(a)
D(b)
D(b)
Data.ind(b)
start timer
timer expires
What do you think of this protocol ?
Coping with errors
A B
Data.req(b) C(OK) Data.ind(a)
D(a)
Data.req(a)
D(b)
D(b)
Data.ind(b)
start timer
timer expires
C(OK) Data.ind(b)
Is this a problem for you ?
A better approach
• Key ideas
• Identify each data segment with a sequence number
• allows to prevent duplication
• one bit is sufficient
• Indicate the sequence number of the last data segment
in the acknowledgement
Alternating Bit Protocol : basics
A B
Data.req(b) C(OK0) Data.ind(a)
D(0,a)
Data.req(a)
D(1,b)
Data.ind(b)
C(OK1)
Data.ind(c)
D(0,c)
Data.req(c)
C(OK0)
Alternating Bit Protocol : reaction to losses
A B
Data.req(b) C(OK0) Data.ind(a)
D(0,a)
Data.req(a)
D(1,b)
Data.ind(b)
Data.req(c)
Lost
D(0,c)
C(OK1)
D(1,b) recvd
Retransmission timer
Data.ind(c)
D(0,c)
C(OK0)
Alternating Bit Protocol : early timer
A B
Data.req(b) C(OK0) Data.ind(a)
D(0,a)
Data.req(a)
Duplicate detected
Which ack to send ?
D(1,b)
Retransmission timer
D(1,b)
Data.ind(b)
Data.req(c)
C(OK1)
D(1,b) recvd
C(OK1)
D(1,b) recvd
Data.ind(c)
D(0,c)
Question
• Do we need to place a checksum/CRC inside the control segments ?
Alternating Bit Protocol : unprotected control
segments
A B
Data.req(b) C(OK0) Data.ind(a)
D(0,a)
Data.req(a)
Duplicate detected
D(1,b)
Retransmission timer
D(1,b)
Data.ind(b)
Data.req(c)
Lost
D(0,c)
C(OK1)
D(1,b) recvd
C(OK0)
D(0,c) recvd
Data.req(d)
D(1,d)
C(OK1)
Undetected
transmission error
Duplicate detected
Alternating bit : sender
Alternating Bit : Receiver
Alternating Bit Protocol
• Advantages
• Simple to implement
• Reliable data transfer
• Drawback
• Performance
• only one segment per round-trip-time
Agenda
• Reliable data transfer over a reliable network
• How unreliable is the Internet ?
• Reliable data transfer techniques
• The Alternating Bit Protocol
• Go-Back-N
• Selective repeat
Pipelining
• Key ideas
• Allow the sender to send several segments without having an explicit ack
• Sender stores unacked segments in a buffer called the sending window to be
able to retransmit them
Pipelining
• How many segments can A send ?
A B
Data.ind(a)
Data.req(a)
...
D(0,a)
...
D(4,e)
Data.req(b)
Data.req(e)
Data.ind(e)
The sending window
• Buffer managed by a sender
• Stores segments sent but not yet acknowledged
• Content of sending window can be retransmitted if needed
• Sending window size limits the number of segments that a host can
sent without acknowledgements
Pipelining example
A B
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 7 8 Data.req(a)
Data.ind(a)
D(0,a)
0 1 2 3 4 5 6 7 8 Data.req(b)
Data.ind(b)
D(1,b)
0 1 2 3 4 5 6 7 8
Data.req(c)
Data.ind(c)
D(2,c)
C(OK0)
C(OK1)
C(OK2)
0 1 2 3 4 5 6 7 8
Data.req(d)
Data.ind(d)
D(3,d)
0 1 2 3 4 5 6 7 8
Data.req(e)
D(4,e)
Sending window
• Sending window must be larger than
bandwidth x round-trip-time to fully use network
Sequence numbers are finite and reused
A B
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
Data.req(a)
Data.ind(a)
D(0,a)
Data.req(b)
Data.ind(b)
D(1,b)
Data.req(c)
Data.ind(c)
D(2,c)
C(OK0)
C(OK1)
C(OK2)
Data.req(d)
Data.ind(d)
D(3,d)
Data.req(e)
D(0,e)
Sending window
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
How to deal with losses ?
• Go-back-n
• Sender stores transmitted segments in sending
window to be able to retransmit them if needed
• Simple receiver, accepts only in-sequence segments. If
a segment is errored, sender retransmits all unacked
segments
• Selective repeat
• Sender stores transmitted segments in sending
window to be able to retransmit them if needed
• Advanced receiver, stores out-of-sequence segments.
If a segment is errored, sender only retransmits the
errored segments
Go-back-n
A B
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
Data.req(e)
Data.req(a)
Data.ind(a)
D(0,a)
Data.req(c)
D(2,c)
C(OK,0)
C(OK,0)
Sending window
Data.req(b)
D(1,b)
Lost
Not expected seq num,
discarded
Retransmission
timer expires
Sending window is full
0 1 2 3
0 1 2 3
D(1,b)
Data.ind(b)
Data.req(d)
D(3,d)
Data.ind(d)
D(2,c)
Data.ind(c)
Go-back-n : receiver
Go-back-n : sender
Go-back-n : example
A B
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
Data.req(e)
Data.req(a)
Data.ind(a)
D(0,a)
Data.req(c)
D(2,c)
C(OK,0)
C(OK,0)
Sending window
Data.req(b)
D(1,b)
Lost
Not expected seq num,
discarded
Retransmission
timer expires
Sending window is full
0 1 2 3
0 1 2 3
D(1,b)
Data.ind(b)
Data.req(d)
D(3,d)
Data.ind(d)
D(2,c)
Data.ind(c)
Question
• You implement a go-back-n receiver using 3 bits
to encode the sequence number. You have
correctly received segment 7 and delivered its
content. You now receive a correct segment 0,
how do you react ?
• you ignore the segment and send ACK(7)
• you accept the segment, deliver it and send ACK(7)
• you accept the segment, deliver it and send ACK(0)
Question
• Go-back-n is used in a network where all data segments are
correctly received, but every second acknowledgement is
corrupted. How many data segments will be retransmitted
by the sender if it needs to reliably send 20 data segments ?
Question
• Go-back-n is used by a protocol that encodes sequence numbers
using 5 bits. What is the largest possible sending window (in
segments) ?
Question
• Go-back-n is used in a satellite network with a round-trip-time of 1
sec. What is the minimum sending window (in segments) to fully
use a 1 Mbps link using 10.000 bits segments ?
Agenda
• Reliable data transfer over a reliable network
• How unreliable is the Internet ?
• Reliable data transfer techniques
• The Alternating Bit Protocol
• Go-Back-N
• Selective repeat
The receive window
• Buffer managed by receiver
• Stores segments received out-of-order
• Segments remain in receive window until gaps are filled
• Receive window size limits the number of segments that the sender
can send without acknowledgements
• Sending window cannot be larger than the other side receive’s window
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Forbidden seq. num.
Window
Already delivered
Not yet received Received
Selective repeat
A B
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
Data.ind(b)
Data.req(a)
Data.ind(a)
D(0,a)
0 1 2 3
Data.req(c)
D(2,c)
C(OK,0)
C(OK,0)
Sending window
Data.req(b)
D(1,b)
Lost
Segment stored
D(1,b)
Retransmission
timer expires
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
Data.ind(c)
Data.req(d)
D(3,d)
Data.ind(d)
0 1 2 3
0 1 2 3
C(OK,2)
C(OK,3)
Rec. window
0 1 2 3
0 1 2 3
Buffer management
• A reliable transport serves a variable number of applications with a
limited buffer
• The buffer/window allocated to a given connection may need to change
dynamically as connections start and stop
Buffer management
A B
Data.req(a)
Data.ind(a)
D(0,a)
C(OK,0, w=1)
C(OK,0,w=3)
Data.req(c)
D(2,c)
2 new buffers become
available
Data.req(b)
Data.ind(b)
D(1,b)
0 1 2 3
0 1 2 3
0 1 2 3
C(OK,1,w=3)
Rwin=1
0 1 2 3
Swin=3, rwin=1
0 1 2 3
Swin=3, rwin=1
0 1 2 3
Swin=3, rwin=1
0 1 2 3
Swin=3, rwin=1
Swin=3, rwin=3
0 1 2 3
Data.req(d)
D(3,d) 0 1 2 3
Buffer management
A B
Data.req(b)
Data.ind(a)
Data.req(a)
D(0,a)
C(OK,0, w=0)
2 new buffers are
available
0 1 2 3
Rwin=1
0 1 2 3
Swin=3, rwin=1
0 1 2 3
Swin=3, rwin=1
0 1 2 3
Receiver cannot handle
segment immediately
C(OK,0,w=3)
Lost segment
0 1 2 3
Swin=3, rwin=0
Window blocked
No transmission possible
Waits for control segment Waits for data segment
How to recover from this deadlock ?
Persistence timer on receiver,
resend control segment after
timer expiration
Bidirectional transfer
• How to efficiently carry data in both directions ?
Piggybacking
A B
Data.req(a)
Data.ind(a)
D(0,0,a)
Data.req(b)
D(1,0,b)
Error
Discarded
Data.req(c)
D(2,0,c)
Segment -> buffer
Retransmission
Data.ind(b)
D(1,5,b)
Data.ind(c)
Data.req(d)
D(3,6,d)
Data.ind(d)
C(OK,2)
C(OK,3)
Data.req(x)
D(5,0,w)
Data.req(w)
Data.ind(w)
D(6,0,x)
Data.ind(x)
D(5,0,w) acks D(0,0,a)
Bytestream
• How to provide a bytestream service ?
Byte stream service (2)
A B
Data.req(ijkl)
Data.req(mnop)
Data.req(abcdef)
Data.ind(ab)
D(0,ab)
C(OK,1)
C(OK,1)
D(2,cd)
Lost segment
D(4,ef)
Placed in buffer
Data.ind(cdef)
D(2,cd)
Expiration timer
Retransmission
D(6,ijklmnop)
Data.ind(ijklmnop)
C(OK,5)
C(OK,13)
Take back lessons
• Usage of Checksums/CRCs
• Finite State Machines
• Cumulative acknowledgements
• Bandwidth x delay product

More Related Content

Similar to Part3-reliable.pptx

Unit 4 data link layer
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layer
mekind
 
Report on data link layer
Report on data link layerReport on data link layer
Report on data link layer
Alisha Korpal
 
Osi model
Osi model Osi model
Osi model
maha tce
 

Similar to Part3-reliable.pptx (20)

Datalinklayer tanenbaum
Datalinklayer tanenbaumDatalinklayer tanenbaum
Datalinklayer tanenbaum
 
Dcn ppt on data link layer
Dcn ppt on data link layerDcn ppt on data link layer
Dcn ppt on data link layer
 
R2 itesm-02
R2 itesm-02R2 itesm-02
R2 itesm-02
 
Ntdd
NtddNtdd
Ntdd
 
Ntdd
NtddNtdd
Ntdd
 
Dcn ppt by roma
Dcn ppt by romaDcn ppt by roma
Dcn ppt by roma
 
Unit 4 data link layer
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layer
 
COmputer Networks Andrew tanenbaum CHAPTER 3
COmputer Networks Andrew tanenbaum CHAPTER 3COmputer Networks Andrew tanenbaum CHAPTER 3
COmputer Networks Andrew tanenbaum CHAPTER 3
 
Computers network Chapter 3 The data link layer.ppt
Computers network Chapter 3 The data link layer.pptComputers network Chapter 3 The data link layer.ppt
Computers network Chapter 3 The data link layer.ppt
 
DLL PPT.ppt
DLL PPT.pptDLL PPT.ppt
DLL PPT.ppt
 
Ch3datalinklayerand layeraa linkdata.ppt
Ch3datalinklayerand layeraa linkdata.pptCh3datalinklayerand layeraa linkdata.ppt
Ch3datalinklayerand layeraa linkdata.ppt
 
datalink.ppt
datalink.pptdatalink.ppt
datalink.ppt
 
Ch3.ppt
Ch3.pptCh3.ppt
Ch3.ppt
 
ppt presentasi kelompok data link layer
ppt presentasi kelompok  data link layerppt presentasi kelompok  data link layer
ppt presentasi kelompok data link layer
 
Report on data link layer
Report on data link layerReport on data link layer
Report on data link layer
 
Transport Layer Description By Varun Tiwari
Transport Layer Description By Varun TiwariTransport Layer Description By Varun Tiwari
Transport Layer Description By Varun Tiwari
 
transport.pptx
transport.pptxtransport.pptx
transport.pptx
 
Osi model
Osi model Osi model
Osi model
 
Chapter3
Chapter3Chapter3
Chapter3
 
Lecture 2 data link layer 1 v1
Lecture 2 data link layer 1 v1Lecture 2 data link layer 1 v1
Lecture 2 data link layer 1 v1
 

More from Olivier Bonaventure

More from Olivier Bonaventure (20)

Part10-router.pptx
Part10-router.pptxPart10-router.pptx
Part10-router.pptx
 
Part1-Intro-Apps.pptx
Part1-Intro-Apps.pptxPart1-Intro-Apps.pptx
Part1-Intro-Apps.pptx
 
Part9-congestion.pptx
Part9-congestion.pptxPart9-congestion.pptx
Part9-congestion.pptx
 
Part2-Apps-Security.pptx
Part2-Apps-Security.pptxPart2-Apps-Security.pptx
Part2-Apps-Security.pptx
 
Part11-lan.pptx
Part11-lan.pptxPart11-lan.pptx
Part11-lan.pptx
 
Part5-tcp-improvements.pptx
Part5-tcp-improvements.pptxPart5-tcp-improvements.pptx
Part5-tcp-improvements.pptx
 
Part8-ibgp.pptx
Part8-ibgp.pptxPart8-ibgp.pptx
Part8-ibgp.pptx
 
Part4-reliable-tcp.pptx
Part4-reliable-tcp.pptxPart4-reliable-tcp.pptx
Part4-reliable-tcp.pptx
 
Part7-routing.pptx
Part7-routing.pptxPart7-routing.pptx
Part7-routing.pptx
 
Part6-network-routing.pptx
Part6-network-routing.pptxPart6-network-routing.pptx
Part6-network-routing.pptx
 
Part1-Intro-Apps.pptx
Part1-Intro-Apps.pptxPart1-Intro-Apps.pptx
Part1-Intro-Apps.pptx
 
Part2-Apps-Security.pptx
Part2-Apps-Security.pptxPart2-Apps-Security.pptx
Part2-Apps-Security.pptx
 
Part4-reliable-tcp.pptx
Part4-reliable-tcp.pptxPart4-reliable-tcp.pptx
Part4-reliable-tcp.pptx
 
A personal journey towards more reproducible networking research
A personal journey towards more reproducible networking researchA personal journey towards more reproducible networking research
A personal journey towards more reproducible networking research
 
Part 12 : Local Area Networks
Part 12 : Local Area Networks Part 12 : Local Area Networks
Part 12 : Local Area Networks
 
Part 11 : Interdomain routing with BGP
Part 11 : Interdomain routing with BGPPart 11 : Interdomain routing with BGP
Part 11 : Interdomain routing with BGP
 
Part 10 : Routing in IP networks and interdomain routing with BGP
Part 10 : Routing in IP networks and interdomain routing with BGPPart 10 : Routing in IP networks and interdomain routing with BGP
Part 10 : Routing in IP networks and interdomain routing with BGP
 
Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6
 
Part 8 : TCP and Congestion control
Part 8 : TCP and Congestion controlPart 8 : TCP and Congestion control
Part 8 : TCP and Congestion control
 
Part 7 : HTTP/2, UDP and TCP
Part 7 : HTTP/2, UDP and TCPPart 7 : HTTP/2, UDP and TCP
Part 7 : HTTP/2, UDP and TCP
 

Recently uploaded

Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
nilamkumrai
 

Recently uploaded (20)

Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
 

Part3-reliable.pptx

  • 1. Part 3 Reliable data transfer over an unreliable network © O. Bonaventure, UCLouvain, 2023. Supplementary material for the Computer Networking : Principles, Protocols and Practice ebook, https://www.computer-networking.info
  • 2. Agenda • Reliable data transfer over a reliable network • How unreliable is the Internet ? • Reliable data transfer techniques • The Alternating Bit Protocol • Go-Back-N • Selective repeat
  • 3. How to reliably transfer data ? • Hypothesis • Internet is fully reliable A B Data.request(a) segment(a) Data.ind(a) Data.request(b) segment(b) Data.ind(b) Data.request(c) segment(c) Data.ind(c)
  • 5. Question • What do we need to add to our “reliable” transfer to allow a datacenter to send data to an Internet of Things device without overflow ?
  • 6. Finite State Machine • Sender • Receiver
  • 7. Control and data segments A B Data.req(b) C(OK) Data.ind(a) D(a) Data.req(a) D(b) Data.ind(b) C(OK) Payload Header Trailer Round trip time (rtt)
  • 8. Question • Two hosts are connected with a 1 Gbps (10^9 bits/sec) network. It takes one msec to deliver a 1000 bits segment from host A to host B. What is the bandwidth that this protocol will achieve (in bits per second) ?
  • 9. Agenda • Reliable data transfer over a reliable network • How unreliable is the Internet ? • Reliable data transfer techniques • The Alternating Bit Protocol • Go-Back-N • Selective repeat
  • 10. The network is imperfect • What can happen to a packet sent over the Internet ? • Packet reaches destination • Packet can suffer transmission errors • Packet contents can be corrupted • Links have typically Bit Error Rates of 10-8 to 10-11 • Wireless suffers from more errors than cable and fiber • Packet can be dropped before reaching destination • Packet can be delayed
  • 12. Internet packet losses What can explain these packet loss ratios ? Based on data extracted by François Michel from measurementlab’s big query
  • 14. Internet performance in Wallonia Broadband access at 30 Mbps or better
  • 15. Initiative Amélie Améliorer Internet partout • Objectif • L’initiative Amélie vise à mettre sur pied une équipe d’étudiant.e.s bénévoles afin de proposer un service de diagnostic Internet d’habitations privées. L’objectif est d’aider les habitants à améliorer la qualité de leur connexion Internet sans nécessairement changer d’offre ou de fournisseur • Mise en oeuvre • Formation à l’analyse des performances en utilisant des outils adaptés et au diagnostic des facteurs qui réduisent les performances • Coaching par des chercheurs qui améliorent Internet et des étudiant.e.s de Master
  • 16. Agenda • Reliable data transfer over a reliable network • How unreliable is the Internet ? • Reliable data transfer techniques • The Alternating Bit Protocol • Go-Back-N • Selective repeat
  • 17. How to deal with transmission errors ? • The receiver must be able to detect that the content of a segment has been modified • Checksum, CRC
  • 18. Question • How should a host react when it receives a data segment with an incorrect checksum ?
  • 19. Coping with errors A B Data.req(b) C(OK) Data.ind(a) D(a) Data.req(a) D(b) D(b) Data.ind(b) start timer timer expires What do you think of this protocol ?
  • 20. Coping with errors A B Data.req(b) C(OK) Data.ind(a) D(a) Data.req(a) D(b) D(b) Data.ind(b) start timer timer expires C(OK) Data.ind(b) Is this a problem for you ?
  • 21. A better approach • Key ideas • Identify each data segment with a sequence number • allows to prevent duplication • one bit is sufficient • Indicate the sequence number of the last data segment in the acknowledgement
  • 22. Alternating Bit Protocol : basics A B Data.req(b) C(OK0) Data.ind(a) D(0,a) Data.req(a) D(1,b) Data.ind(b) C(OK1) Data.ind(c) D(0,c) Data.req(c) C(OK0)
  • 23. Alternating Bit Protocol : reaction to losses A B Data.req(b) C(OK0) Data.ind(a) D(0,a) Data.req(a) D(1,b) Data.ind(b) Data.req(c) Lost D(0,c) C(OK1) D(1,b) recvd Retransmission timer Data.ind(c) D(0,c) C(OK0)
  • 24. Alternating Bit Protocol : early timer A B Data.req(b) C(OK0) Data.ind(a) D(0,a) Data.req(a) Duplicate detected Which ack to send ? D(1,b) Retransmission timer D(1,b) Data.ind(b) Data.req(c) C(OK1) D(1,b) recvd C(OK1) D(1,b) recvd Data.ind(c) D(0,c)
  • 25. Question • Do we need to place a checksum/CRC inside the control segments ?
  • 26. Alternating Bit Protocol : unprotected control segments A B Data.req(b) C(OK0) Data.ind(a) D(0,a) Data.req(a) Duplicate detected D(1,b) Retransmission timer D(1,b) Data.ind(b) Data.req(c) Lost D(0,c) C(OK1) D(1,b) recvd C(OK0) D(0,c) recvd Data.req(d) D(1,d) C(OK1) Undetected transmission error Duplicate detected
  • 28. Alternating Bit : Receiver
  • 29. Alternating Bit Protocol • Advantages • Simple to implement • Reliable data transfer • Drawback • Performance • only one segment per round-trip-time
  • 30. Agenda • Reliable data transfer over a reliable network • How unreliable is the Internet ? • Reliable data transfer techniques • The Alternating Bit Protocol • Go-Back-N • Selective repeat
  • 31. Pipelining • Key ideas • Allow the sender to send several segments without having an explicit ack • Sender stores unacked segments in a buffer called the sending window to be able to retransmit them
  • 32. Pipelining • How many segments can A send ? A B Data.ind(a) Data.req(a) ... D(0,a) ... D(4,e) Data.req(b) Data.req(e) Data.ind(e)
  • 33. The sending window • Buffer managed by a sender • Stores segments sent but not yet acknowledged • Content of sending window can be retransmitted if needed • Sending window size limits the number of segments that a host can sent without acknowledgements
  • 34. Pipelining example A B 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 Data.req(a) Data.ind(a) D(0,a) 0 1 2 3 4 5 6 7 8 Data.req(b) Data.ind(b) D(1,b) 0 1 2 3 4 5 6 7 8 Data.req(c) Data.ind(c) D(2,c) C(OK0) C(OK1) C(OK2) 0 1 2 3 4 5 6 7 8 Data.req(d) Data.ind(d) D(3,d) 0 1 2 3 4 5 6 7 8 Data.req(e) D(4,e) Sending window • Sending window must be larger than bandwidth x round-trip-time to fully use network
  • 35. Sequence numbers are finite and reused A B 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 Data.req(a) Data.ind(a) D(0,a) Data.req(b) Data.ind(b) D(1,b) Data.req(c) Data.ind(c) D(2,c) C(OK0) C(OK1) C(OK2) Data.req(d) Data.ind(d) D(3,d) Data.req(e) D(0,e) Sending window 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
  • 36. How to deal with losses ? • Go-back-n • Sender stores transmitted segments in sending window to be able to retransmit them if needed • Simple receiver, accepts only in-sequence segments. If a segment is errored, sender retransmits all unacked segments • Selective repeat • Sender stores transmitted segments in sending window to be able to retransmit them if needed • Advanced receiver, stores out-of-sequence segments. If a segment is errored, sender only retransmits the errored segments
  • 37. Go-back-n A B 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 Data.req(e) Data.req(a) Data.ind(a) D(0,a) Data.req(c) D(2,c) C(OK,0) C(OK,0) Sending window Data.req(b) D(1,b) Lost Not expected seq num, discarded Retransmission timer expires Sending window is full 0 1 2 3 0 1 2 3 D(1,b) Data.ind(b) Data.req(d) D(3,d) Data.ind(d) D(2,c) Data.ind(c)
  • 40. Go-back-n : example A B 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 Data.req(e) Data.req(a) Data.ind(a) D(0,a) Data.req(c) D(2,c) C(OK,0) C(OK,0) Sending window Data.req(b) D(1,b) Lost Not expected seq num, discarded Retransmission timer expires Sending window is full 0 1 2 3 0 1 2 3 D(1,b) Data.ind(b) Data.req(d) D(3,d) Data.ind(d) D(2,c) Data.ind(c)
  • 41. Question • You implement a go-back-n receiver using 3 bits to encode the sequence number. You have correctly received segment 7 and delivered its content. You now receive a correct segment 0, how do you react ? • you ignore the segment and send ACK(7) • you accept the segment, deliver it and send ACK(7) • you accept the segment, deliver it and send ACK(0)
  • 42. Question • Go-back-n is used in a network where all data segments are correctly received, but every second acknowledgement is corrupted. How many data segments will be retransmitted by the sender if it needs to reliably send 20 data segments ?
  • 43. Question • Go-back-n is used by a protocol that encodes sequence numbers using 5 bits. What is the largest possible sending window (in segments) ?
  • 44. Question • Go-back-n is used in a satellite network with a round-trip-time of 1 sec. What is the minimum sending window (in segments) to fully use a 1 Mbps link using 10.000 bits segments ?
  • 45. Agenda • Reliable data transfer over a reliable network • How unreliable is the Internet ? • Reliable data transfer techniques • The Alternating Bit Protocol • Go-Back-N • Selective repeat
  • 46. The receive window • Buffer managed by receiver • Stores segments received out-of-order • Segments remain in receive window until gaps are filled • Receive window size limits the number of segments that the sender can send without acknowledgements • Sending window cannot be larger than the other side receive’s window 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Forbidden seq. num. Window Already delivered Not yet received Received
  • 47. Selective repeat A B 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 Data.ind(b) Data.req(a) Data.ind(a) D(0,a) 0 1 2 3 Data.req(c) D(2,c) C(OK,0) C(OK,0) Sending window Data.req(b) D(1,b) Lost Segment stored D(1,b) Retransmission timer expires 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 Data.ind(c) Data.req(d) D(3,d) Data.ind(d) 0 1 2 3 0 1 2 3 C(OK,2) C(OK,3) Rec. window 0 1 2 3 0 1 2 3
  • 48. Buffer management • A reliable transport serves a variable number of applications with a limited buffer • The buffer/window allocated to a given connection may need to change dynamically as connections start and stop
  • 49. Buffer management A B Data.req(a) Data.ind(a) D(0,a) C(OK,0, w=1) C(OK,0,w=3) Data.req(c) D(2,c) 2 new buffers become available Data.req(b) Data.ind(b) D(1,b) 0 1 2 3 0 1 2 3 0 1 2 3 C(OK,1,w=3) Rwin=1 0 1 2 3 Swin=3, rwin=1 0 1 2 3 Swin=3, rwin=1 0 1 2 3 Swin=3, rwin=1 0 1 2 3 Swin=3, rwin=1 Swin=3, rwin=3 0 1 2 3 Data.req(d) D(3,d) 0 1 2 3
  • 50. Buffer management A B Data.req(b) Data.ind(a) Data.req(a) D(0,a) C(OK,0, w=0) 2 new buffers are available 0 1 2 3 Rwin=1 0 1 2 3 Swin=3, rwin=1 0 1 2 3 Swin=3, rwin=1 0 1 2 3 Receiver cannot handle segment immediately C(OK,0,w=3) Lost segment 0 1 2 3 Swin=3, rwin=0 Window blocked No transmission possible Waits for control segment Waits for data segment How to recover from this deadlock ? Persistence timer on receiver, resend control segment after timer expiration
  • 51. Bidirectional transfer • How to efficiently carry data in both directions ?
  • 52. Piggybacking A B Data.req(a) Data.ind(a) D(0,0,a) Data.req(b) D(1,0,b) Error Discarded Data.req(c) D(2,0,c) Segment -> buffer Retransmission Data.ind(b) D(1,5,b) Data.ind(c) Data.req(d) D(3,6,d) Data.ind(d) C(OK,2) C(OK,3) Data.req(x) D(5,0,w) Data.req(w) Data.ind(w) D(6,0,x) Data.ind(x) D(5,0,w) acks D(0,0,a)
  • 53. Bytestream • How to provide a bytestream service ?
  • 54. Byte stream service (2) A B Data.req(ijkl) Data.req(mnop) Data.req(abcdef) Data.ind(ab) D(0,ab) C(OK,1) C(OK,1) D(2,cd) Lost segment D(4,ef) Placed in buffer Data.ind(cdef) D(2,cd) Expiration timer Retransmission D(6,ijklmnop) Data.ind(ijklmnop) C(OK,5) C(OK,13)
  • 55. Take back lessons • Usage of Checksums/CRCs • Finite State Machines • Cumulative acknowledgements • Bandwidth x delay product