1 Reliable Data Transfer. 2 r Problem: Reliability  Want an abstraction of a reliable link even though packets can be corrupted or get lost r Solution:

Slides:



Advertisements
Similar presentations
CS 4284 Systems Capstone Networking Godmar Back.
Advertisements

Transport Layer 4 Slides from Kurose and Ross
Transport Layer 3-1 Transport services and protocols  provide logical communication between app processes running on different hosts  transport protocols.
Chapter 11 Data Link Control
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.
Chapter 3 outline 3.1 transport-layer services
Transport Layer Transport Layer. Reliable data transfer: getting started send side receive side rdt_send(): called from above, (e.g., by app.).
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
1 Outline r Transport-layer services r Multiplexing and demultiplexing r Connectionless transport: UDP r Principles of reliable data transfer.
Transport Layer3-1 Data Communication and Networks Lecture 6 Reliable Data Transfer October 12, 2006.
Announcement Project 1 due last night, how is that ? Project 2 almost ready, out tomorrow, will post online –Much harder than project 1, start early!
Announcement Project 1 due last night, how is that ? Homework 1 grade, comments out –Will be discussed in the next lecture Homework 2 out Project 2 almost.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Transport Layer3-1 Reliable Data Transfer. Transport Layer3-2 Principles of Reliable data transfer r important in app., transport, link layers r top-10.
3-1 Sect. 3.4 Principles of reliable data transfer Computer Networking: A Top Down Approach Featuring the Internet, 1 st edition. Jim Kurose, Keith Ross.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
2: Application Layer 1 1DT066 Distributed Information System Chapter 3 Transport Layer.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture r Transport-layer services r Multiplexing and demultiplexing r Connectionless.
Reliable Data Transfer#1#1 Reliable Data Transfer.
3-1 Transport services and protocols r provide logical communication between app processes running on different hosts r transport protocols run in end.
1 Transport Layer goals: r understand principles behind transport layer services: m multiplexing/demultiplexing m reliable data transfer m flow control.
Reliable Data Transfer#1#1 Reliable Data Transfer.
Principles of Reliable Data Transfer. Reliable Delivery Making sure that the packets sent by the sender are correctly and reliably received by the receiver.
Transport Protocols. Introduction Protocols – what are they used for? ◦ Transferring application information among machines (“transporting” protocols)
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 
Transport Layer1 Reliable Transfer Ram Dantu (compiled from various text books)
CSCI 3335: C OMPUTER N ETWORKS C HAPTER 3 T RANSPORT L AYER Vamsi Paruchuri University of Central Arkansas Some.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
3: Transport Layer 3a-1 8: Principles of Reliable Data Transfer Last Modified: 10/15/2015 7:04:07 PM Slides adapted from: J.F Kurose and K.W. Ross,
Transport Layer 3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m sockets m reliable data transfer m.
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.
Transport Layer 3-1 From Computer Networking: A Top Down Approach Featuring the Internet by Jim Kurose, Keith Ross Addison-Wesley, A note on the use of.
Review:. Chapter 3: The Data Link Layer –achieve reliable, efficient communication between two physically connected machines. –Example problems to be.
rdt2.2: a NAK-free protocol
Transport Layer Goals: Overview:
Part 3: Transport Layer: Reliable Data Transfer CSE 3461/5461 Reading: Section 3.4, Kurose and Ross 1.
Transport Layer3-1 rdt2.1: sender, handles garbled ACK/NAKs Wait for call 0 from above sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) rdt_send(data)
Transport Layer 3-1 Chapter 3 outline 3.4 Principles of reliable data transfer.
September 24 th, 2013 CS1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
1 John Magee 10 February 2014 CS 280: Transport Layer: Reliable Data Transfer Most slides adapted from Kurose and Ross, Computer Networking 6/e Source.
Before The Canned Slides r What sort of things did you learn from Mikes talk on Friday? r Mini-homework this week: create a wiki page with cross-referenced.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
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
Transport Layer Our goals:
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Principles of reliable data transfer 0.
9: Pipelined Protocols and RTT Transport Layer 3-1 Slides adapted from: J.F Kurose and K.W. Ross,
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Data Link Layer Part II – Sliding Window Protocols.
Introduction 1 Lecture 11 Transport Layer (Reliable Data Transfer) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science.
Application Layer 2-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
1 The utopia protocol  Unrealistic assumptions: –processing time ignored –infinite buffer space available –simplex: data transmitted in one direction.
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.
Chapter 3 Transport Layer
The Data Link Layer.
Performance of rdt3.0 rdt3.0 works, but performance stinks
Chapter 3 outline 3.1 transport-layer services
Last time Reliable Data Transfer
rdt2.2: a NAK-free protocol
rdt2.2: a NAK-free protocol
rdt2.2: a NAK-free protocol
rdt2.2: a NAK-free protocol
rdt2.2: a NAK-free protocol
Chapter 3 outline 3.1 transport-layer services
The Transport Layer Reliability
Chapter 3 Transport Layer
CS 5565 Network Architecture and Protocols
rdt2.2: a NAK-free protocol
Presentation transcript:

1 Reliable Data Transfer

2 r Problem: Reliability  Want an abstraction of a reliable link even though packets can be corrupted or get lost r Solution: keep track of the packets  Not as simple as one would expect

3 Themes r Principles for Reliable transfer r Protocols as State machines r More Pipelining r Protocols  ABP, Go-back N, Selective repeat

4 Principles of Reliable data transfer r important in app, transport, link layers r top-10 list of important networking topics!

5 Reliable data transfer: getting started send side receive side rdt_send(): called from above, (e.g., by app.). Passed data to deliver to receiver upper layer udt_send(): called by rdt, to transfer packet over unreliable channel to receiver rdt_rcv(): called when packet arrives on rcv-side of channel deliver_data(): called by rdt to deliver data to upper

6 Reliable data transfer: getting started r Consider only unidirectional data transfer  but control info will flow on both directions! r Characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt)  incrementally develop sender, receiver sides of reliable data transfer protocol (rdt)

7 Reliable transmission &Flow Control r What to do when there is a packet loss?  On the link (in the network)  At the receiver (buffer overflow) r Need to recoup losses r What happens if the packet is lost in the network?  A random event, retransmit r What happens if the sender tries to transmit faster than the receiver can accept?  Data will be lost unless flow control is implemented

8 Controlling the Flow of Data Slow Joe Fast Frank

9 Some Flow Control Algorithms  Flow control for the ideal network  Stop and Wait for noiseless channels  Stop and Wait for noisy channels  Sliding window protocols  Sliding window with error control Go Back N Selective Repeat

10 Flow control in the ideal network Assumptions: Error free transmission link, Infinite buffer at the receiver No acknowledgement of frames necessary Since the data link is error-free and the receiver can buffer as many frames as it likes, no frame will ever be lost

11 Flow control in the ideal network (cont’d) Slow Joe Fast Frank Infinite bucket

12 Stop and Wait with Noiseless Channels Assumptions: Error free transmission link, Finite buffer at the receiver Problem of Buffer overflow at the receiver n Buffer overflow may happen at the receiver when the sending router sends frames at a rate faster than the receiving router

13 stop-and-wait operation first packet bit transmitted, t = 0 senderreceiver RTT last packet bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R

14 Performance of stop and wait r example: 1 Gbps link, 15 ms e-e prop. delay, 1KB packet: T transmit = 8kb/pkt 10**9 b/sec = 8 microsec  U sender : utilization – fraction of time sender busy sending  1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link  network protocol limits use of physical resources! L (packet length in bits) R (transmission rate, bps) =

15 Stop and Wait with Noiseless Channels (cont’d) Slow Joe Fast Frank Finite bucket (once full, ball is lost)

16 Stop and Wait with Noiseless Channels (cont’d) r Solution: Stop-and-Wait  The receiver sends an acknowledgement frame telling the sender to transmit the next data frame.  The sender waits for the ACK, and if the ACK comes, it transmits the next data frame.  Use 0/1 as sequence numbers  Also known as Alternating bit protocol (ABP)

17 Stop and Wait with Noiseless Channels (cont’d) Data ACK Data

18 Stop and Wait (cont’d) r Note that we assume an error-free transmission link and therefore ACK frames will not be lost r In this flow control protocol, there are two types of frames: data frames and ACK frames. The ACK frames don’t contain any particular information, since only the arrival of the ACK frame at the sender is important.

19 Stop and Wait for Noisy Channels Assumptions: Transmission link may cause errors in frames, Finite buffer at the receiver ACK frames may now be lost

20 Problems introduced by a noisy line Problem 1: Loss of a data or ACK frame  Since the transmission link is not error-free, a data or ACK frame may be lost, causing the sender to wait indefinitely for an ACK

21 Loss of an ACK frame ACK Data error ?

22 Problems introduced by a noisy line Can we solve problem 1 by introducing a timeout period for the sender? Yes, but... Problem 2: Duplicated frames  If the ACK frame for a certain data frame is lost, the sender will retransmit the same frame after a time-out period, and the receiver will then have two copies of the same frame

23 Duplicated data frames Data ACK Data Timed Out Duplicate data

24 Stop and Wait for Noisy Channels (cont’d) r Solution:  The sender uses a timer to retransmit data frames when an ACK has not arrived  The sender includes a sequence number in each frame to distinguish one frame from another. This way, the receiver knows when it has received duplicate frames.

25 Stop and Wait for Noisy Channels (cont’d) Data ACK Data Timed Out receiver knows to discard this data 1

26 Is Stop and Wait the best we can do? Stop and Wait is an effective form of flow control, but… It’s not very efficient. 1. Only one data frame can be in transit on the link at a time 2. When waiting for an acknowledgement, the sender cannot transmit any frames Better solution? Sliding Window

27 Pipelined protocols Pipelining: sender allows multiple, “in-flight”, yet-to- be-acknowledged pkts

28 Sliding Window Protocols Definitions Sequence Number: Each frame is assigned a sequence number that is incremented as each frame is transmitted Sender Window: Keeps track of sequence numbers for frames that have been sent but not yet acknowledged Receiver Window: Keeps track of sequence numbers for frames the receiver is allowed to accept Maximum Sender Window size: The maximum number of frames the sender may transmit without receiving any acknowledgements Maximum Receiver Window size: The maximum number of frames the receiver may receive before returning an acknowledgement to the sender

29 Simple Sliding Window with Window Size of 1 A sliding window with a maximum window size of 1 frame Window for a 3-bit sequence number

30 Sliding Window example Sender window Receiver window (a)(b)(c)(d) (a) Initial state, no frames transmitted, receiver expects frame 0 (b) Sender transmits frame 0, receiver buffers frame 0 (c) Receiver ACKS frame 0 (d) Sender receives ACK, removes frame 0

31 Simple Sliding Window with Window size 1 (cont’d) This protocol behaves identically to stop and wait for a noisy channel

32 Sliding Window Protocols General Remarks r The sending and receiving windows do not necessarily have the same maximum size r Any frame whose sequence number falls outside the receiver window is discarded at the receiver r The sender window’s size grows and shrinks as frames are transmitted and acknowledged r Unlike the sender window, the receiver window always remains at its maximum size

33 Sliding Window Protocols Piggybacking Acknowledgements Since we have full duplex transmission, we can “piggyback” an ACK onto the header of an outgoing data frame to make better use of the channel When a data frame arrives at a router, instead of immediately sending a separate ACK frame, the router waits until it is passed the next data frame to send. The acknowledgement is attached to the outgoing data frame.

34 Sliding Window with Maximum Sender Window Size W S With a maximum window size of 1, the sender waits for an ACK before sending another frame With a maximum window size of W S, the sender can transmit up to W S frames before “being blocked” This allows the sender to transmit several frames before waiting for an acknowledgement

35 Sender-Side Window with W S = (a)(b)(c)(d) (e)(f)(g)(h) (a) Initial window state (b) Send frame 0 (c) Send frame 1 (d) ACK for frame 0 arrives (e) Send frame 2 (f ) ACK for frame 1 arrives (g) ACK for frame 2 arrives, send frame 3 (h) ACK for frame 3 arrives

36 Pipelining Sliding window with W S > 1 is also called “pipelined” communication AB 99 data stream ACK stream By allowing several frames onto the link before receiving an acknowledgement, pipelining keeps the link from being idle

37 Pipelining Example: increased utilization first packet bit transmitted, t = 0 senderreceiver RTT last bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R last bit of 2 nd packet arrives, send ACK last bit of 3 rd packet arrives, send ACK Increase utilization by a factor of 3!

38 Sliding Window with Maximum Receiver Window Size W R With a maximum window size of 1, the receiver must receive and process every frame in sequence With a maximum window size of W R, the receiver can receive and process up to W R frames before acknowledging them This is useful when frames are lost: the receiver can still accept and buffer frames after the missing frame

39 Receiver-Side Window with W R = (a)(b)(c)(d) (e)(f)(g)(h) (a) Initial window state (b) Nothing happens (c) Frame 0 arrives, ACK frame 0 (d) Nothing happens (e) Frame 1 arrives, ACK frame 1 (f) Frame 2 arrives, ACK frame 2 (g) Nothing happens (h) Frame 3 arrives, ACK frame 3

40 What about Errors? What if a data or acknowledgement frame is lost when using a sliding window protocol? Two Solutions: Go Back N Selective Repeat

41 Pipelined protocols - how? Pipelining: sender allows multiple, “in-flight”, yet-to- be-acknowledged pkts  range of sequence numbers must be increased  buffering at sender and/or receiver r Two generic forms of pipelined protocols: go-Back-N, selective repeat

42 Sliding Window with Go Back N r When the receiver notices a missing or erroneous frame, it simply discards all frames with greater sequence numbers and sends no ACK r The sender will eventually time out and retransmit all the frames in its sending window

43 Go Back N Discarded by receiver Frame with error Timeout interval ACK 0 Time Sender Receiver Maximum window size = 8 Maximum window size = ACK 1 2 E 3 D 4 D 23 2 ACK ACK 3 ACK 4 ACK 5 6 ACK 6

44 Go-Back-N Sender: r k-bit seq # in pkt header r “window” of up to N, consecutive unack’ed pkts allowed r ACK(n): ACKs all pkts up to seq # n - “cumulative ACK” r timeout(n): retransmit pkt n and all higher seq # pkts in window r One timer for all in-flight pkts

45 Go Back N (cont’d) Go Back N can recover from erroneous or missing frames But… It is wasteful. If there are errors, the sender will spend time retransmitting frames the receiver has already seen

46 Sliding Window with Selective Repeat The sender retransmits only the frame with errors r The receiver stores all the correct frames that arrive following the bad one. (Note that the receiver requires a frame buffer for each sequence number in its receiver window.) r When the receiver notices a skipped sequence number, it keeps acknowledging the last good sequence number r When the sender times out waiting for an acknowledgement, it just retransmits the one unacknowledged frame, not all its successors.

47 Selective Repeat Buffered by receiver Frame with error Timeout interval ACK 0 Time Sender Receiver Maximum window size = 8 Maximum window size = ACK 1 2 E ACK ACK 5 6 ACK 6 34 ACK 1

48 Selective repeat: sender, receiver windows