150 likes | 349 Views
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
E N D
Fundamentals of Computer NetworksECE 478/578 Lecture #7: Reliable Transmission Instructor: LoukasLazos 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
Simplex Protocol – Lossless Channel Data flows one direction only Communication channel never loses frames 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 Sender Receiver request reply negotiate ack . . .
Simplex Protocol – Lossy Channel Stop-and-wait
Failure of the Stop-and-Wait ACK is lost or arrives after timeout
Solution based on Sequence No Use a one-bit sequence number on the header Sender Receiver Frame 0 ACK Frame 0 Frame 1 ACK Frame 0
(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
Go-back-N Protocol Main idea: Leave up to N frames unacknowledged at any given time
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
Sliding Window Depicted At the sender At the receiver
Updating Variables 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 Si SWS RWS Receiver Variables LFRi LAFi Sender Variables LSFi LARi
Example of Go-Back-N Sender Receiver Max Sequence Number SWS + 1 Link does not re-arrange packets SWS = 4 RWS = 1 0 1 LFR = 0 LAF = 1 2 Timeout 3 LFS = 4 LAR = 0 4 discarded 1 2
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
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)
Example of Selective Repeat Sender Receiver Max Sequence Number 2 SWS SWS = 4 RWS = 4 0 1 LFR = 0 LAF = 4 2 Timeout 3 LFS = 4 LAR = 0 4 Buffered 1 LFS = 4 LAR = 4 5 6 7