Fundamentals of Computer Networks ECE 478/578

Download Report

Transcript Fundamentals of Computer Networks ECE 478/578

Fundamentals of Computer Networks
ECE 478/578
Lecture #7: Reliable Transmission
Instructor: Loukas Lazos
Dept of Electrical and Computer Engineering
University of Arizona
Reliable Transmission
Transmission strategies under a lossless channel
Simplex connection
Simplex Stop-and-wait
Transmission Strategies under a lossy channel
Process of retransmitting frames that cannot be corrected by CRC codes
Stop-and-wait
Go-back-N
Selective repeat
2
Simplex Protocol – Lossless Channel
Data flows one direction only
Communication channel never loses frames
Sender
Receiver
request
reply
negotiate
ack
Receiver is always ready to receive packets
Problem: receiver can be flooded if it does
not process packets fast enough
. . .
Solution: Introduce delay at sender
3
Simplex Protocol – Lossy Channel
Stop-and-wait
4
Failure of the Stop-and-Wait
ACK is lost or arrives after timeout
5
Solution based on Sequence No
Use a one-bit sequence number on the header
Sender
Receiver
6
(In)Efficiency of Stop-and-Wait
Example: Consider 1.5Mbps link, 45ms RTT
Delay x Bandwidth =67.5kb = 8KB
If frames are 1KB long then max rate
1024 x 8 /0.045 = 182Kbps
Only 1/8th of link’s capacity
Goal: keep the pipe full, i.e. have maximum # of bits unacknowledged
at any given time
Our example, we could have 8 frames unacknowledged
7
Go-back-N Protocol
Main idea: Leave up to N frames unacknowledged at any given time
8
Go-Back-N
Each frame is assigned a SeqNum
Variables at the sender
SWS: Send Window Size
LAR: Last Acknowledgment Received
LFS: Last Frame Sent
Rule: LFS – LAR  SWS (at most SWS frames unACKed)
Variables at the receiver
RWS: Receive Window Size
LAF: Largest Acceptable Frame (in seq #)
LFR: Last Frame Received
Rule: LAF – LFR  RWS
9
Sliding Window Depicted
At the sender
At the receiver
10
Updating Variables
SWS
Sender Variables
LSFi
LARi
Si
RWS
Receiver Variables
LFRi
LAFi
Si = LFRi+1 (Go-back-N only accepts packets in order)
Si  LAFi (which is guaranteed in our case, for RWS  1)
LSFi+1 =LSF + 1, LFRi+1 = LFRi + 1, LAFi+1 = LAFi + 1
Window at sender advanced only if ACK received
11
Example of Go-Back-N
SWS = 4
LFS = 4
LAR = 0
Sender
Timeout

Receiver

RWS = 1
LFR = 0
LAF = 1
discarded
Max Sequence Number  SWS + 1
Link does not re-arrange packets
12
Piggypacking
Duplex communication, attach ACK on the reply frame
Asymmetry in frame size can cause timeouts
Go-Back-N can be turned into Stop-and-Wait
Sender
Receiver
13
Selective Repeat
Window size can be very large for nets with large delay x bandwidth
Inefficient to retransmit all N frames if one is lost
Selective repeat allows the re-transmission of only the lost packets
Accepts out-of-order packets
Simply increase the RWS up to SWS (does not make sense to allow for
RWS > SWS)
14
Example of Selective Repeat
SWS = 4
LFS = 4
LAR = 0
Sender
Timeout

Receiver

RWS = 4
LFR = 0
LAF = 4
Buffered
LFS = 4
LAR = 4
Max Sequence Number  2 SWS
15