SlideShare a Scribd company logo
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

Datalinklayer tanenbaum
Datalinklayer tanenbaumDatalinklayer tanenbaum
Datalinklayer tanenbaum
Mahesh Kumar Chelimilla
 
Dcn ppt on data link layer
Dcn ppt on data link layerDcn ppt on data link layer
Dcn ppt on data link layer
roma bora
 
R2 itesm-02
R2 itesm-02R2 itesm-02
Ntdd
NtddNtdd
Ntdd
NtddNtdd
Dcn ppt by roma
Dcn ppt by romaDcn ppt by roma
Dcn ppt by roma
boraroma
 
Unit 4 data link layer
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layer
mekind
 
COmputer Networks Andrew tanenbaum CHAPTER 3
COmputer Networks Andrew tanenbaum CHAPTER 3COmputer Networks Andrew tanenbaum CHAPTER 3
COmputer Networks Andrew tanenbaum CHAPTER 3
MrMRajaCSESTAFF
 
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
kekeuwoe
 
DLL PPT.ppt
DLL PPT.pptDLL PPT.ppt
DLL PPT.ppt
SmtPArunaKumari
 
datalink.ppt
datalink.pptdatalink.ppt
datalink.ppt
ThangamaniR3
 
ppt presentasi kelompok data link layer
ppt presentasi kelompok  data link layerppt presentasi kelompok  data link layer
ppt presentasi kelompok data link layer
rosedinda4
 
Ch3.ppt
Ch3.pptCh3.ppt
Ch3.ppt
Thirft
 
Ch3datalinklayerand layeraa linkdata.ppt
Ch3datalinklayerand layeraa linkdata.pptCh3datalinklayerand layeraa linkdata.ppt
Ch3datalinklayerand layeraa linkdata.ppt
BlackHat41
 
Report on data link layer
Report on data link layerReport on data link layer
Report on data link layer
Alisha Korpal
 
Transport Layer Description By Varun Tiwari
Transport Layer Description By Varun TiwariTransport Layer Description By Varun Tiwari
Computer network transport layer MODUL 2.pptx
Computer network transport layer MODUL 2.pptxComputer network transport layer MODUL 2.pptx
Computer network transport layer MODUL 2.pptx
pallavir61
 
transport.pptx
transport.pptxtransport.pptx
transport.pptx
jatinder42
 
Osi model
Osi model Osi model
Osi model
maha tce
 
Chapter3
Chapter3Chapter3
Chapter3
Nagarajan
 

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
 
datalink.ppt
datalink.pptdatalink.ppt
datalink.ppt
 
ppt presentasi kelompok data link layer
ppt presentasi kelompok  data link layerppt presentasi kelompok  data link layer
ppt presentasi kelompok data link layer
 
Ch3.ppt
Ch3.pptCh3.ppt
Ch3.ppt
 
Ch3datalinklayerand layeraa linkdata.ppt
Ch3datalinklayerand layeraa linkdata.pptCh3datalinklayerand layeraa linkdata.ppt
Ch3datalinklayerand layeraa linkdata.ppt
 
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
 
Computer network transport layer MODUL 2.pptx
Computer network transport layer MODUL 2.pptxComputer network transport layer MODUL 2.pptx
Computer network transport layer MODUL 2.pptx
 
transport.pptx
transport.pptxtransport.pptx
transport.pptx
 
Osi model
Osi model Osi model
Osi model
 
Chapter3
Chapter3Chapter3
Chapter3
 

More from Olivier Bonaventure

Part10-router.pptx
Part10-router.pptxPart10-router.pptx
Part10-router.pptx
Olivier Bonaventure
 
Part1-Intro-Apps.pptx
Part1-Intro-Apps.pptxPart1-Intro-Apps.pptx
Part1-Intro-Apps.pptx
Olivier Bonaventure
 
Part9-congestion.pptx
Part9-congestion.pptxPart9-congestion.pptx
Part9-congestion.pptx
Olivier Bonaventure
 
Part2-Apps-Security.pptx
Part2-Apps-Security.pptxPart2-Apps-Security.pptx
Part2-Apps-Security.pptx
Olivier Bonaventure
 
Part11-lan.pptx
Part11-lan.pptxPart11-lan.pptx
Part11-lan.pptx
Olivier Bonaventure
 
Part5-tcp-improvements.pptx
Part5-tcp-improvements.pptxPart5-tcp-improvements.pptx
Part5-tcp-improvements.pptx
Olivier Bonaventure
 
Part8-ibgp.pptx
Part8-ibgp.pptxPart8-ibgp.pptx
Part8-ibgp.pptx
Olivier Bonaventure
 
Part4-reliable-tcp.pptx
Part4-reliable-tcp.pptxPart4-reliable-tcp.pptx
Part4-reliable-tcp.pptx
Olivier Bonaventure
 
Part7-routing.pptx
Part7-routing.pptxPart7-routing.pptx
Part7-routing.pptx
Olivier Bonaventure
 
Part6-network-routing.pptx
Part6-network-routing.pptxPart6-network-routing.pptx
Part6-network-routing.pptx
Olivier Bonaventure
 
Part1-Intro-Apps.pptx
Part1-Intro-Apps.pptxPart1-Intro-Apps.pptx
Part1-Intro-Apps.pptx
Olivier Bonaventure
 
Part2-Apps-Security.pptx
Part2-Apps-Security.pptxPart2-Apps-Security.pptx
Part2-Apps-Security.pptx
Olivier Bonaventure
 
Part4-reliable-tcp.pptx
Part4-reliable-tcp.pptxPart4-reliable-tcp.pptx
Part4-reliable-tcp.pptx
Olivier Bonaventure
 
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
Olivier Bonaventure
 
Part 12 : Local Area Networks
Part 12 : Local Area Networks Part 12 : Local Area Networks
Part 12 : Local Area Networks
Olivier Bonaventure
 
Part 11 : Interdomain routing with BGP
Part 11 : Interdomain routing with BGPPart 11 : Interdomain routing with BGP
Part 11 : Interdomain routing with BGP
Olivier Bonaventure
 
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
Olivier Bonaventure
 
Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6
Olivier Bonaventure
 
Part 8 : TCP and Congestion control
Part 8 : TCP and Congestion controlPart 8 : TCP and Congestion control
Part 8 : TCP and Congestion control
Olivier Bonaventure
 
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
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

Do it again anti Republican shirt Do it again anti Republican shirt
Do it again anti Republican shirt Do it again anti Republican shirtDo it again anti Republican shirt Do it again anti Republican shirt
Do it again anti Republican shirt Do it again anti Republican shirt
exgf28
 
IPv6 Deployment Planning and Security Considerations
IPv6 Deployment Planning and Security ConsiderationsIPv6 Deployment Planning and Security Considerations
IPv6 Deployment Planning and Security Considerations
Bangladesh Network Operators Group
 
University of California, Riverside diploma
University of California, Riverside diplomaUniversity of California, Riverside diploma
University of California, Riverside diploma
eufdev
 
Best Skills to Learn for Freelancing.pdf
Best Skills to Learn for Freelancing.pdfBest Skills to Learn for Freelancing.pdf
Best Skills to Learn for Freelancing.pdf
Million-$-Knowledge {Million Dollar Knowledge}
 
How God led me to DTS? Through many different signs and connections that I c...
How God led me to DTS? Through many different signs and connections that  I c...How God led me to DTS? Through many different signs and connections that  I c...
How God led me to DTS? Through many different signs and connections that I c...
AshishMohan57
 
My President is bulletproof t shirts hoodie
My President is bulletproof t shirts hoodieMy President is bulletproof t shirts hoodie
My President is bulletproof t shirts hoodie
exgf28
 
Career Development Advice for Network Engineers across the Pacific, presented...
Career Development Advice for Network Engineers across the Pacific, presented...Career Development Advice for Network Engineers across the Pacific, presented...
Career Development Advice for Network Engineers across the Pacific, presented...
APNIC
 
Geolocation and Geofeed Implementation bdNOG18
Geolocation and Geofeed Implementation bdNOG18Geolocation and Geofeed Implementation bdNOG18
Geolocation and Geofeed Implementation bdNOG18
Bangladesh Network Operators Group
 
Trump fist pump t shirts Trump fist pump t shirts
Trump fist pump t shirts Trump fist pump t shirtsTrump fist pump t shirts Trump fist pump t shirts
Trump fist pump t shirts Trump fist pump t shirts
exgf28
 
202254.com香蕉影视,沙丘2在线播放,沙丘2线上看,最新电影沙丘2在线,热门电影推荐,2024最新科幻片推荐。
202254.com香蕉影视,沙丘2在线播放,沙丘2线上看,最新电影沙丘2在线,热门电影推荐,2024最新科幻片推荐。202254.com香蕉影视,沙丘2在线播放,沙丘2线上看,最新电影沙丘2在线,热门电影推荐,2024最新科幻片推荐。
202254.com香蕉影视,沙丘2在线播放,沙丘2线上看,最新电影沙丘2在线,热门电影推荐,2024最新科幻片推荐。
yilin01100
 
Study of international anticancer research trends.pdf
Study of international anticancer research trends.pdfStudy of international anticancer research trends.pdf
Study of international anticancer research trends.pdf
Preston University
 
Rent remote desktop server mangohost .net
Rent remote desktop server mangohost .netRent remote desktop server mangohost .net
Rent remote desktop server mangohost .net
pdfsubmission50
 
Software Defined Networking, Concepts and Practical Implementations
Software Defined Networking, Concepts and Practical ImplementationsSoftware Defined Networking, Concepts and Practical Implementations
Software Defined Networking, Concepts and Practical Implementations
Bangladesh Network Operators Group
 
Team Cymru Community Services,Overview of all public services
Team Cymru Community Services,Overview of all public servicesTeam Cymru Community Services,Overview of all public services
Team Cymru Community Services,Overview of all public services
Bangladesh Network Operators Group
 
upgrade to zabbix-7 0 como atualiza lts1
upgrade to zabbix-7 0 como atualiza lts1upgrade to zabbix-7 0 como atualiza lts1
upgrade to zabbix-7 0 como atualiza lts1
diogolsew
 
Enhancing seamless access using TIGERfed
Enhancing seamless access using TIGERfedEnhancing seamless access using TIGERfed
Enhancing seamless access using TIGERfed
Bangladesh Network Operators Group
 
Open Source TCP or Netflow Log Server Using Graylog
Open Source TCP or Netflow Log Server Using GraylogOpen Source TCP or Netflow Log Server Using Graylog
Open Source TCP or Netflow Log Server Using Graylog
Bangladesh Network Operators Group
 
Trump Assassination Shirt Trump Assassination Shirt
Trump Assassination Shirt Trump Assassination ShirtTrump Assassination Shirt Trump Assassination Shirt
Trump Assassination Shirt Trump Assassination Shirt
exgf28
 
Understanding Threat Intelligence | What is Threat Intelligence
Understanding Threat Intelligence | What is Threat IntelligenceUnderstanding Threat Intelligence | What is Threat Intelligence
Understanding Threat Intelligence | What is Threat Intelligence
Lumiverse Solutions Pvt Ltd
 
Saint Louis University diploma
Saint Louis University diplomaSaint Louis University diploma
Saint Louis University diploma
eufdev
 

Recently uploaded (20)

Do it again anti Republican shirt Do it again anti Republican shirt
Do it again anti Republican shirt Do it again anti Republican shirtDo it again anti Republican shirt Do it again anti Republican shirt
Do it again anti Republican shirt Do it again anti Republican shirt
 
IPv6 Deployment Planning and Security Considerations
IPv6 Deployment Planning and Security ConsiderationsIPv6 Deployment Planning and Security Considerations
IPv6 Deployment Planning and Security Considerations
 
University of California, Riverside diploma
University of California, Riverside diplomaUniversity of California, Riverside diploma
University of California, Riverside diploma
 
Best Skills to Learn for Freelancing.pdf
Best Skills to Learn for Freelancing.pdfBest Skills to Learn for Freelancing.pdf
Best Skills to Learn for Freelancing.pdf
 
How God led me to DTS? Through many different signs and connections that I c...
How God led me to DTS? Through many different signs and connections that  I c...How God led me to DTS? Through many different signs and connections that  I c...
How God led me to DTS? Through many different signs and connections that I c...
 
My President is bulletproof t shirts hoodie
My President is bulletproof t shirts hoodieMy President is bulletproof t shirts hoodie
My President is bulletproof t shirts hoodie
 
Career Development Advice for Network Engineers across the Pacific, presented...
Career Development Advice for Network Engineers across the Pacific, presented...Career Development Advice for Network Engineers across the Pacific, presented...
Career Development Advice for Network Engineers across the Pacific, presented...
 
Geolocation and Geofeed Implementation bdNOG18
Geolocation and Geofeed Implementation bdNOG18Geolocation and Geofeed Implementation bdNOG18
Geolocation and Geofeed Implementation bdNOG18
 
Trump fist pump t shirts Trump fist pump t shirts
Trump fist pump t shirts Trump fist pump t shirtsTrump fist pump t shirts Trump fist pump t shirts
Trump fist pump t shirts Trump fist pump t shirts
 
202254.com香蕉影视,沙丘2在线播放,沙丘2线上看,最新电影沙丘2在线,热门电影推荐,2024最新科幻片推荐。
202254.com香蕉影视,沙丘2在线播放,沙丘2线上看,最新电影沙丘2在线,热门电影推荐,2024最新科幻片推荐。202254.com香蕉影视,沙丘2在线播放,沙丘2线上看,最新电影沙丘2在线,热门电影推荐,2024最新科幻片推荐。
202254.com香蕉影视,沙丘2在线播放,沙丘2线上看,最新电影沙丘2在线,热门电影推荐,2024最新科幻片推荐。
 
Study of international anticancer research trends.pdf
Study of international anticancer research trends.pdfStudy of international anticancer research trends.pdf
Study of international anticancer research trends.pdf
 
Rent remote desktop server mangohost .net
Rent remote desktop server mangohost .netRent remote desktop server mangohost .net
Rent remote desktop server mangohost .net
 
Software Defined Networking, Concepts and Practical Implementations
Software Defined Networking, Concepts and Practical ImplementationsSoftware Defined Networking, Concepts and Practical Implementations
Software Defined Networking, Concepts and Practical Implementations
 
Team Cymru Community Services,Overview of all public services
Team Cymru Community Services,Overview of all public servicesTeam Cymru Community Services,Overview of all public services
Team Cymru Community Services,Overview of all public services
 
upgrade to zabbix-7 0 como atualiza lts1
upgrade to zabbix-7 0 como atualiza lts1upgrade to zabbix-7 0 como atualiza lts1
upgrade to zabbix-7 0 como atualiza lts1
 
Enhancing seamless access using TIGERfed
Enhancing seamless access using TIGERfedEnhancing seamless access using TIGERfed
Enhancing seamless access using TIGERfed
 
Open Source TCP or Netflow Log Server Using Graylog
Open Source TCP or Netflow Log Server Using GraylogOpen Source TCP or Netflow Log Server Using Graylog
Open Source TCP or Netflow Log Server Using Graylog
 
Trump Assassination Shirt Trump Assassination Shirt
Trump Assassination Shirt Trump Assassination ShirtTrump Assassination Shirt Trump Assassination Shirt
Trump Assassination Shirt Trump Assassination Shirt
 
Understanding Threat Intelligence | What is Threat Intelligence
Understanding Threat Intelligence | What is Threat IntelligenceUnderstanding Threat Intelligence | What is Threat Intelligence
Understanding Threat Intelligence | What is Threat Intelligence
 
Saint Louis University diploma
Saint Louis University diplomaSaint Louis University diploma
Saint Louis University diploma
 

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