10. Principles of Reliable Data Transport – Part 2

Slides:



Advertisements
Similar presentations
Transport Layer 4 Slides from Kurose and Ross
Advertisements

Go-Back-N Improve Stop-and-Wait by not waiting!
Flow and Error Control. Flow Control Flow control coordinates the amount of data that can be sent before receiving acknowledgement It is one of the most.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
3-1 Transport services and protocols r provide logical communication between app processes running on different hosts r transport protocols run in end.
Principles of Reliable Data Transfer. Reliable Delivery Making sure that the packets sent by the sender are correctly and reliably received by the receiver.
Go-Back-N ARQ  packets transmitted continuously (when available) without waiting for ACK, up to N outstanding, unACK’ed packets  a logically different.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
15-1 Last time □ Reliable Data Transfer ♦ Provide rdt over unreliable network layer ♦ FSM model ♦ rdt 1.0: rdt over reliable channels ♦ rdt 2.0: rdt over.
Chapter 5 Peer-to-Peer Protocols and Data Link Layer PART I: Peer-to-Peer Protocols ARQ Protocols and Reliable Data Transfer Flow Control.
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
rdt2.2: a NAK-free protocol
Copyright © Lopamudra Roychoudhuri
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Transport Layer: Sliding Window Reliability
Data Link Layer Flow and Error Control. Flow Control Flow Control Flow Control Specifies the amount of data can be transmitted by sender before receiving.
9: Pipelined Protocols and RTT Transport Layer 3-1 Slides adapted from: J.F Kurose and K.W. Ross,
1 Direct Link Networks: Reliable Transmission Sections 2.5.
DATA LINK CONTROL. DATA LINK LAYER RESPONSIBILTIES  FRAMING  ERROR CONTROL  FLOW CONTROL.
Computer Networking Lecture 16 – Reliable Transport.
1 COMP 431 Internet Services & Protocols The Transport Layer Pipelined Transport Protocols Jasleen Kaur March 29, 2016.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 4 : Chapter 7 Data & computer.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
Powerpoint Templates Data Communication Muhammad Waseem Iqbal Lec # 15.
Go Back-N : a bit of practice
Go-Back-N ARQ packets transmitted continuously (when available) without waiting for ACK, up to N outstanding, unACK’ed packets a logically different sender.
9. Principles of Reliable Data Transport – Part 1
TCP Selective Acknowledgement Options
Chapter 3 Transport Layer
Computer Communication & Networks
TCP - Part II.
2.10 Flow and Error Control Before that ...
Fast Retransmit For sliding windows flow control we waited for a timer to expire before beginning retransmission of a packet TCP uses an additional mechanism.
Reliable Transmission
Data Link Layer Flow Control.
Part III Datalink Layer 10.
Chapter 23 Introduction To Transport Layer
Performance of rdt3.0 rdt3.0 works, but performance stinks
Chapter 3 Transport Layer
Last time Reliable Data Transfer
Data Communications and Networking Pipelined reliable data transfer
Instructor Mazhar Hussain
Introduction of Transport Protocols
Flow Control.
ECE 4450:427/527 - Computer Networks Spring 2017
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
Flow and Error Control.
rdt2.2: a NAK-free protocol
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Reliable transmission
Dr. John P. Abraham Professor UTPA
CSS432 (Link Level Protocols) Reliable Transmission Textbook Ch 2.5
rdt2.2: a NAK-free protocol
rdt2.2: a NAK-free protocol
CS4470 Computer Networking Protocols
rdt2.2: a NAK-free protocol
Dr. John P. Abraham Professor UTPA
Advanced Computer Networks
rdt2.2: a NAK-free protocol
Chapter 3 outline 3.1 transport-layer services
Getting Connected (Chapter 2 Part 3)
9: Pipelined Protocols and RTT
The Transport Layer Reliability
Transport Layer Outline Intro to transport UDP
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Lecture 4 Peer-to-Peer Protocols and Data Link Layer
Chapter 3 Transport Layer
Error detection: Outline
rdt2.2: a NAK-free protocol
Presentation transcript:

10. Principles of Reliable Data Transport – Part 2 Basic concepts Stop-and-wait protocol Go-Back-N protocol Selective Repeat protocol Roch Guerin (with adaptations from Jon Turner and John DeHart, and material from Kurose and Ross)

Improving RDT 3.0 Basic goal is to be able to transmit non-stop under normal (no errors) operation first ack must arrive before the sender finishes transmission of Nth packet To enable more efficient operation, we want a protocol that can keep transmitting while waiting for acks, i.e., one that pipelines transmissions sender can transmit up to N packets while waiting for acks each packet labeled with sequence # from set of S>N sequence #s receiver sends acks with sequence numbers Two major variants go-back-N (cumulative ack) and selective repeat (specific ack)

Go-back-N with N=4 lost packet selective lost packet go-back repeat ✕ A0 A2 A3 timeout A1 lost packet go-back normal case P0 P0 P1 P1 P2 ✕ P2 P3 timeout P3 A0 A0 A0 A1 A0 A2 P1 A3 P2 P3 A1 A2 A3

Go-Back-N Operation Allow pkt transmissions as long as LPS-LAR ≤ SWS Sender variables Send window size: SWS=N Last pkt sent: LPS Last ack received: LAR Allow pkt transmissions as long as LPS-LAR ≤ SWS If LPS-LAR ≤ SWS, send next pkt with SN = LPS+1 ACK for pkt number X>LAR updates LAR to X (slides the window) Note that X ≠ LAR+1 is OK (cumulative ACKs acknowledge all pkts up to X) Receiver variables Receive window size: RWS (= 1) Last pkt received: LPR Latest acceptable pkt: LAP Need: LAP-LPR ≤ RWS i.e., LAP = RWS +LPR (RWS=1  only one acceptable pkt) When pkt SN arrives (with RWS=1) If SN !=LPR+1, discard pkt Only accepts packets in order Else accept pkt and set LPR = SN Send (cumulative) ACK for LPR It is a cumulative ACK but it is always just 1 more than last ACK sent!

Go-Back-N – Sender & Receiver SWS LAR LPS LPS - LAR ≤ SWS RECEIVER RWS LPR LAP LAP- LPR ≤ RWS LAR: Last Ack Received, LPS: Last Packet Sent, SWS=N: Send Window Size LPR: Last Packet Received, LAP: Latest Acceptable Packet, RWS: Receive Window Size

Buffering & Numbering Packets Sender How big should S be? Obviously) S ≥ SWS Suppose S=4 (Seq. Num. field {0,…,3}) and SWS = 4 Sender transmit frames 0,…,3 Arrive successfully, but all ACKs are lost Sender retransmits 0,…,3 (after timeout) Receiver expects new 0,…,3, gets second incarnation of old 0,…,3, incorrectly accepts as new In general, we need S ≥ RWS + SWS 7 1 copies of unacked packets 6 2 5 3 4 ready to send 4 Protocol uses sequence numbers 0…S–1=2m-1 Re-use sequence numbers in circular fashion all sequence number arithmetic is modulo S Window size SWS specifies number of pkts that can be unacknowledged Sequence numbers 0 – N-1 =( 2^m) - 1 , What is m? Number of bits in Sequence number.

Go-Back-N State Machines Receiver (start in state 0) state i expecting packet i receive packet i deliver packet and send ack i state i+1 receive packet k≠i send ack i–1 mod S mod S state (i,j) oldest unacked packet is i, next packet to send gets seq#j packet available and j–i<SWS send packet j, save copy, start timer state (i,j+1) state (k+1,j) receive ack k if k in i..j–1 discard packet copies i..k, for k≤j stop timers mod S timeout resend packets i..j–1, restart timers Sender (start in (0,0))

Go-Back-N Performance Performance depends on Time-out value (timer starts when last bit of packet is sent) Assume tout = ( - 1)tpkt ≥ RTT As RTT increases, tout would increase tpkt : transmission time of packet Value of window size N Assume N is large enough to keep the pipe full in the absence of losses, i.e., (N–1)tpkt > RTT Impact and frequency of retransmissions Expected Time for a Successful Packet Transmission: Tsucc We need to know: Time for the initial transmission: tpkt Expected number of retransmissions: E[R] Time for a single retransmission: Tr Tsucc = E[R] Tr + tpkt

Go-Back-N Performance Let Tr be the time spent for one retransmission Tr = tpkt + tout = tpkt Time spent per packet: T = RTr + tpkt R is number of retransmissions (geometrically distributed) E[R]=q/(1-q), where q is the pkt loss probability Expected time for successful packet transmission Next pages show how we get to the above equation 100% throughput if tpkt = Tsucc Achievable when q=0 (no pkt or ACK losses) For a given value of q, throughput decreases as , i.e., RTT, increases

Retransmissions as a Geometrically Distributed Random Variable Packet loss probability: q (we can ignore ack losses) R retransmissions means that packet transmissions fail R times before succeeding P(R retransmissions) = qR(1–q) E[R] = {R=0 to ∞}RqR(1–q) = q(1–q){R=0 to ∞}RqR-1 = q(1–q)/(1–q)2 =q/(1–q) So a successful transmission requires one original transmission plus R retransmissions, for a total time of tpkt + R (tout + tpkt), or on average tpkt + tpkt x q/(1–q) = tpktx(1 + (–1)q)/(1–q)

Go-Back-N Performance (continued) Derivation of Tsucc Tsucc = E[R] Ttotal + tpkt E[R] = q/(1-q) and Ttotal = tpkt Tsucc = (q/(1-q)) tpkt + tpkt Tsucc = (q/(1-q)) tpkt + tpkt (1-q)/(1-q) Tsucc = (qtpkt /(1-q)) + (tpkt - qtpkt )/(1-q) Tsucc = (qtpkt + tpkt - qtpkt )/(1-q) Tsucc = tpkt (q+ 1 - q)/(1-q) Tsucc = (1 + ( - 1)q) tpkt /(1-q)

Receive Buffer in Selective Repeat 1 2 4 3 6 5 7 waiting for packet 1 Receiver maintains buffer of up to RWS=SWS=N packets On receiving packet i, send ack i If arriving packet is in window range and no previous copy is in buffer, store new packet If arriving packet is next one expected deliver it and all other packets up until the first “hole” in buffer advance window to location of first hole Correct operation calls for in-order packet delivery and S≥2N (S is the number of sequence numbers) Why? If the windows size is greater than half the sequence number space, then if an ACK is lost, the sender may send new packets that the receiver believes are retransmissions. For example, assume SWS=RWS=2 and S=3 (0, 1, 2). Sender A sends packets 0 and 1, receiver B acks both, but ack for 1 is lost. When receiving the ack for 0, A sends 2 that is also correctly received by B. After a time-out, A resends 1 that is interpreted by B as being packet #4 with #3 having been lost (or delayed).

Selective Repeat State Machines Receiver (start in state 0) state i expecting packet i receive packet i send ack i, let j be index of first “hole”, deliver packets i..j–1 state j receive packet k≠i send ack k, if k in i..i+W–1 and no copy of k in buffer, store k in buffer Sender (start in (0,0)) state (i,j) oldest unacked packet is i, next packet to send gets seq# j packet available and j–i<W send packet j, save copy, start timer Tj state (i,j+1) state (i’,j) receive ack k in i..j–1 discard packet k, clear timer Tk, let i’ be seq# of oldest unacked packet, or j receive ack k not in i..j–1 do nothing timer Tk times out resend packet k, restart Tk

Exercises Draw a time-space diagram for the go-back-N protocol with N=3, S=6, assuming that five packets are sent, and the second and fifth packets are lost the first time they are sent. Show the states of the sender and receiver.

Go-back-N with N=3, S=6 (0,0) (0,1) (0,2) P0 P1 (0,3) Draw a time-space diagram for the go-back-N protocol with N=3, S=6, assuming that five packets are sent, and the second and fifth packets are lost the first time they are sent. Show the states of the sender and receiver. Sender: (ack-waiting, nxt_pkt) Receiver: (expecting_pkt) Sender state starts at (0,0) and eventually ends at (5,5) when ack for P4 is received. Receiver state starts at 0 and ends at 5 P2 ✕ timeout A0 1 (1,4) A0 P1 P3 P2 P3 2 A0 3 (1,4) A1 (2,5) A2 (3,5) A3 (4,5) P4 ✕ timeout 4 P4 A4 5 (5,5)

Exercises Consider a link that uses go-back-N with S=10, N=5. Suppose 4 packets have been sent and 2 acks have been received. What is the smallest possible number of packets that could still be in the send buffer? What is the largest number?

Exercises Consider a link that uses go-back-N with S=10, N=5. Suppose 4 packets have been sent and 2 acks have been received. What is the smallest possible number of packets that could still be in the send buffer? What is the largest number? Consider a scenario, where the first and second packets are lost. This will trigger ACKs when the third and fourth packets arrive, acknowledging receipt of the packet before the first (or the SYN packet). Under such a scenario, the two acks will not be for any of the four packets that have been sent, so that the sender will still have all four in its send buffer. In the best case, the two acks are for the 3rd and 4th packets and there are zero packets left in the send buffer (acks for packets 1 and 2 were lost).

Exercises Draw a time-space diagram for the selective repeat protocol with N=3, S=6, assuming that five packets are sent, and the second and fifth packets are lost the first time they are sent. Show when each packet is delivered and the states of the sender and receiver at each step.

Selective Repeat with N=3, S=6 (0,1) Selective Repeat with N=3, S=6 (0,2) P0 P1 P2 ✕ (0,3) timeout A0 A2 Draw a time-space diagram for the selective repeat protocol with N=3, S=6, assuming that five packets are sent, and the second and fifth packets are lost the first time they are sent. Show when each packet is delivered and the states of the sender and receiver at each step. State starts at (0,0) and eventually ends at (5,5) when ack for P4 is received 1 P3 P1 (1,4) 1,2,3 4 A3 A1 (4,5) P4 ✕ 4 timeout P4 4 5

Exercises Consider a link that uses selective repeat with S=10, N=5. Suppose 4 packets have been sent and 2 acks have been received. What is the smallest possible number of packets that could still be in the send buffer? What is the largest number?

Exercises Consider a link that uses selective repeat with S=10, N=5. Suppose 4 packets have been sent and 2 acks have been received. What is the smallest possible number of packets that could still be in the send buffer? What is the largest number? With selective repeat, packets are acked individually. So in all cases, the receipt of two ACKs identifies two packets (out of four) that have been received. Hence, there will then be two packets in the sender’s send buffer (even if all four packets were successfully received). Note that in practice, selective acknowledgments are used in combination with cumulative ACKs, e.g., through the use of a SACK option as in TCP (see RFC 2018). This helps overcome the fragility problem caused by requiring that each packet be individually acked. In particular, TCP’s SACK option allows the receiver to inform the sender of multiple (up to 4) non-contiguous blocks of data it received. It is used in combination with regular ACKs.