CPSC 441: Reliable Transport1 Reliable Data Transfer Instructor: Carey Williamson Office: ICT 740 Class.

Slides:



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

Transport Layer3-1 Homework r Chapter 2#10,13-18 r Due Wed September 17.
Transport Layer 4 Slides from Kurose and Ross
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.
The Future r There will be a Wireshark TCP homework up on the wiki later today. It will be due Wednesday. r The next test is coming soon – next Wednesday????
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
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.
Chapter 3 Transport Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 9.
Transport Layer3-1 Reliable Data Transfer. Transport Layer3-2 Principles of Reliable data transfer r important in app., transport, link layers r top-10.
1 Outline r Transport-layer services r Multiplexing and demultiplexing r Connectionless transport: UDP r Principles of reliable data transfer.
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,
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.
9/30/ /2/2003 The Transport Layer September 30-October 2, 2003.
1 Transport Layer goals: r understand principles behind transport layer services: m multiplexing/demultiplexing m reliable data transfer m flow control.
Transport Layer3-1 Data Communication and Networks Lecture 5  Transport Protocols: Multiplexing and Reliable Data Transfer October 7, 2004.
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 
CSCI 3335: C OMPUTER N ETWORKS C HAPTER 3 T RANSPORT L AYER Vamsi Paruchuri University of Central Arkansas Some.
Transport Layer 3-1 Chapter 3 outline 3.1 transport-layer services 3.2 multiplexing and demultiplexing 3.3 connectionless transport: UDP 3.4 principles.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
14-1 Last time □ Mobility in Cellular networks ♦ HLR, VLR, MSC ♦ Handoff □ Transport Layer ♦ Introduction ♦ Multiplexing / demultiplexing ♦ UDP.
Transport Layer 3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m sockets m reliable data transfer m.
CS 3830 Day 15 Introduction 1-1. Announcements r Quiz 3: Wednesday, Oct 10 r Prog3 due (in 1DropBox) on Wednesday, Oct 10 r Prog4: m Parts A and B m Work.
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.
rdt2.2: a NAK-free protocol
Part 3: Transport Layer: Reliable Data Transfer CSE 3461/5461 Reading: Section 3.4, Kurose and Ross 1.
Chapter 3, slide: 1 CS 372 – introduction to computer networks* Thursday July 8 Announcements: r Lab 3 is posted and due is Monday July 19. r Midterm is.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
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.
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 Part.
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.
Introduction 1-1 Lecture 6 Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 CS3516: These slides.
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 All.
Transport Layer Our goals:
9: Pipelined Protocols and RTT Transport Layer 3-1 Slides adapted from: J.F Kurose and K.W. Ross,
Important r Midterm will be on m FRIDAY, Feb. 12th 1.
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.
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 COMP 431 Internet Services & Protocols The Transport Layer Pipelined Transport Protocols Jasleen Kaur March 29, 2016.
Chapter 3 Transport Layer
Chapter 3 Transport Layer
Chapter 3 outline 3.1 transport-layer services
Last time Reliable Data Transfer
EEC-484/584 Computer Networks
rdt2.2: a NAK-free protocol
Transport Layer Our goals:
EEC-484/584 Computer Networks
EEC-484/584 Computer Networks
rdt2.2: a NAK-free protocol
rdt2.2: a NAK-free protocol
EEC-484/584 Computer Networks
rdt2.2: a NAK-free protocol
EEC-484/584 Computer Networks
rdt2.2: a NAK-free protocol
Chapter 3 outline 3.1 transport-layer services
Chapter 3 Transport Layer
Never take life seriously. Nobody gets out alive anyway
9: Pipelined Protocols and RTT
EEC-484/584 Computer Networks
Chapter 3 Transport Layer
rdt2.0: FSM specification
CS 5565 Network Architecture and Protocols
rdt2.2: a NAK-free protocol
Presentation transcript:

CPSC 441: Reliable Transport1 Reliable Data Transfer Instructor: Carey Williamson Office: ICT Class Location: ICT 122 Lectures: MWF 12:00 – 12:50 Notes derived from “ Computer Networking: A Top Down Approach”, by Jim Kurose and Keith Ross, Addison-Wesley. Slides are adapted from the book’s companion Web site, with changes by Anirban Mahanti and Carey Williamson.

CPSC 441: Reliable Transport2 Principles of Reliable Data Transfer r important in application, transport, and link layers r top-10 list of important networking topics! r characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Sending Process Receiving Process Reliable Channel Sending Process Receiving Process Unreliable Channel RDT protocol ( sending side) RDT protocol ( receiving side) Application Layer Network Layer Transport Layer

CPSC 441: Reliable Transport3 Reliable Data Transfer: FSMs We’ll: r incrementally develop sender, receiver sides of reliable data transfer protocol (rdt) r consider only unidirectional data transfer m but control info will flow on both directions! r use finite state machines (FSM) to specify sender, receiver state 1 state 2 event causing state transition actions taken on state transition state: when in this “state” next state uniquely determined by next event event actions

CPSC 441: Reliable Transport4 Rdt1.0: Data Transfer over a Perfect Channel r underlying channel perfectly reliable m no bit errors m no loss of packets r separate FSMs for sender, receiver: m sender sends data into underlying channel m receiver read data from underlying channel Wait for call from above packet = make_pkt(data) udt_send(packet) rdt_send(data) extract (packet,data) deliver_data(data) Wait for call from below rdt_rcv(packet) sender receiver

CPSC 441: Reliable Transport5 Rdt2.0: channel with bit errors [stop & wait protocol] r Assumptions m All packets are received m Packets may be corrupted (i.e., bits may be flipped) m Checksum to detect bit errors r How to recover from errors? Use ARQ mechanism m acknowledgements (ACKs): receiver explicitly tells sender that packet received correctly m negative acknowledgements (NAKs): receiver explicitly tells sender that packet had errors m sender retransmits pkt on receipt of NAK r What about error correcting codes?

CPSC 441: Reliable Transport6 rdt2.0: FSM specification Wait for call from above snkpkt = make_pkt(data, checksum) udt_send(sndpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) udt_send(NAK) rdt_rcv(rcvpkt) && corrupt(rcvpkt) Wait for ACK or NAK Wait for call from below sender receiver rdt_send(data) 

CPSC 441: Reliable Transport7 rdt2.0: Observations Wait for call from above snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for ACK or NAK sender rdt_send(data)  1. A stop-and-Wait protocol 2. What happens when ACK or NAK has bit errors? Approach 1: resend the current data packet? Duplicate packets

CPSC 441: Reliable Transport8 Handling Duplicate Packets r sender adds sequence number to each packet r sender retransmits current packet if ACK/NAK garbled r receiver discards (doesn’t deliver up) duplicate packet

CPSC 441: Reliable Transport9 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) Wait for ACK or NAK 0 udt_send(sndpkt) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isNAK(rcvpkt) ) sndpkt = make_pkt(1, data, checksum) udt_send(sndpkt) rdt_send(data) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt) udt_send(sndpkt) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isNAK(rcvpkt) ) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt) Wait for call 1 from above Wait for ACK or NAK 1  

CPSC 441: Reliable Transport10 rdt2.1: receiver, handles garbled ACK/NAKs Wait for 0 from below sndpkt = make_pkt(NAK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && not corrupt(rcvpkt) && has_seq0(rcvpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq1(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) Wait for 1 from below rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq0(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && (corrupt(rcvpkt) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && not corrupt(rcvpkt) && has_seq1(rcvpkt) rdt_rcv(rcvpkt) && (corrupt(rcvpkt) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) sndpkt = make_pkt(NAK, chksum) udt_send(sndpkt)

CPSC 441: Reliable Transport11 rtd2.1: examples PKT(0) PKT(1) ACK senderreceiver x Receiver expects a pkt with seq. # 1 Duplicate pkt. senderreceiver PKT(0) ACK PKT(1) NAK PKT(1) ACK PKT(0) x x

CPSC 441: Reliable Transport12 rdt2.1: summary Sender: r seq # added to pkt r two seq. #’s (0,1) will suffice. Why? r must check if received ACK/NAK corrupted r twice as many states m state must “remember” whether “current” pkt has 0 or 1 seq. # Receiver: r must check if received packet is duplicate m state indicates whether 0 or 1 is expected pkt seq # r note: receiver can not know if its last ACK/NAK received OK at sender

CPSC 441: Reliable Transport13 rdt2.2: a NAK-free protocol r same functionality as rdt2.1, using ACKs only r instead of NAK, receiver sends ACK for last pkt received OK m receiver must explicitly include seq # of pkt being ACKed r duplicate ACK at sender results in same action as NAK: retransmit current pkt

CPSC 441: Reliable Transport14 rdt2.2: sender, receiver fragments Wait for call 0 from above sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) rdt_send(data) udt_send(sndpkt) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,1) ) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,0) Wait for ACK 0 sender FSM fragment Wait for 0 from below rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq1(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK1, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && (corrupt(rcvpkt) || has_seq1(rcvpkt)) udt_send(sndpkt) receiver FSM fragment 

CPSC 441: Reliable Transport15 rdt3.0:The case of “Lossy” Channels r Assumption: underlying channel can also lose packets (data or ACKs) r Approach: sender waits “reasonable” amount of time for ACK (a Time-Out) m Time-out value? m Possibility of duplicate packets/ACKs? r if pkt (or ACK) just delayed (not lost): m retransmission will be duplicate, but use of seq. #’s already handles this m receiver must specify seq # of pkt being ACKed

CPSC 441: Reliable Transport16 rdt3.0 sender sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) start_timer rdt_send(data) Wait for ACK0 rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,1) ) Wait for call 1 from above sndpkt = make_pkt(1, data, checksum) udt_send(sndpkt) start_timer rdt_send(data) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,0) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,0) ) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,1) stop_timer udt_send(sndpkt) start_timer timeout udt_send(sndpkt) start_timer timeout rdt_rcv(rcvpkt) Wait for call 0from above Wait for ACK1  rdt_rcv(rcvpkt)   

CPSC 441: Reliable Transport17 rdt3.0 in action

CPSC 441: Reliable Transport18 rdt3.0 in action

CPSC 441: Reliable Transport19 stop-and-wait operation first packet bit transmitted, t = 0 senderreceiver D last packet bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = D + L / R

CPSC 441: Reliable Transport20 Pipelining: Motivation r Stop-and-wait allows the sender to only have a single unACKed packet at any time r example: 1 Mbps link (R), end-2-end round trip propagation delay (D) of 92ms, 1KB packet (L): m 1KB pkt every 100 ms -> 80Kbps throughput on a 1 Mbps link m What does bandwidth x delay product tell us? T transmit = 8kb/pkt 10**3 kb/sec = 8 ms L (packet length in bits) R (transmission rate, bps) =

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

CPSC 441: Reliable Transport22 Pipelining: increased utilization first packet bit transmitted, t = 0 senderreceiver D last bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = D + 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!

CPSC 441: Reliable Transport23 Go-Back-N r Allow up to N unACKed pkts in the network m N is the Window size r Sender Operation: m If window not full, transmit m ACKs are cumulative m On timeout, send all packets previously sent but not yet ACKed. m Uses a single timer – represents the oldest transmitted, but not yet ACKed pkt

CPSC 441: Reliable Transport24 GBN: sender extended FSM Wait start_timer udt_send(sndpkt[base]) udt_send(sndpkt[base+1]) … udt_send(sndpkt[nextseqnum-1]) timeout rdt_send(data) if (nextseqnum < base+N) { sndpkt[nextseqnum] = make_pkt(nextseqnum,data,chksum) udt_send(sndpkt[nextseqnum]) if (base == nextseqnum) start_timer nextseqnum++ } else refuse_data(data) base = getacknum(rcvpkt)+1 If (base == nextseqnum) stop_timer else start_timer rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) base=1 nextseqnum=1 rdt_rcv(rcvpkt) && corrupt(rcvpkt) 

CPSC 441: Reliable Transport25 GBN: receiver extended FSM ACK-only: always send ACK for correctly-received pkt with highest in-order seq # m may generate duplicate ACKs  need only remember expectedseqnum r out-of-order pkt: m discard (don’t buffer) -> no receiver buffering! m Re-ACK pkt with highest in-order seq # Wait udt_send(sndpkt) default rdt_rcv(rcvpkt) && notcurrupt(rcvpkt) && hasseqnum(rcvpkt,expectedseqnum) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(expectedseqnum,ACK,chksum) udt_send(sndpkt) expectedseqnum++ expectedseqnum=1 sndpkt = make_pkt(expectedseqnum,ACK,chksum) 

CPSC 441: Reliable Transport26 GBN in action

CPSC 441: Reliable Transport27 Selective Repeat r receiver individually acknowledges all correctly received pkts m buffers pkts, as needed, for eventual in-order delivery to upper layer r sender only resends pkts for which ACK not received m sender timer for each unACKed pkt r sender window m N consecutive seq #’s m again limits seq #s of sent, unACKed pkts

CPSC 441: Reliable Transport28 Selective repeat: sender, receiver windows

CPSC 441: Reliable Transport29 Selective repeat data from above : r if next available seq # in window, send pkt timeout(n): r resend pkt n, restart timer ACK(n) in [sendbase,sendbase+N]: r mark pkt n as received r if n smallest unACKed pkt, advance window base to next unACKed seq # sender pkt n in [rcvbase, rcvbase+N-1] r send ACK(n) r out-of-order: buffer r in-order: deliver (also deliver buffered, in-order pkts), advance window to next not-yet-received pkt pkt n in [rcvbase-N,rcvbase-1] r ACK(n) otherwise: r ignore receiver

CPSC 441: Reliable Transport30 Selective Repeat Example PKT0 PKT1 PKT2 PKT3 ACK0 ACK1 ACK2 ACK PKT PKT1 ACK1 ACK Time-Out Sender Receiver

CPSC 441: Reliable Transport31 Another Example

CPSC 441: Reliable Transport32 Selective repeat: dilemma Example: r seq #’s: 0, 1, 2, 3 r window size=3 r receiver sees no difference in two scenarios! r incorrectly passes duplicate data as new in (a) Q: what relationship between seq # size and window size?