Data Communications & Networks. Session 6 Main Theme Reliable Data Transfer. Dr. Jean-Claude Franchitti



Similar documents
SIP: Session Initiation Protocol

CSE331: Introduction to Networks and Security. Lecture 9 Fall 2006

Midterm Exam CMPSCI 453: Computer Networks Fall 2011 Prof. Jim Kurose

Computer Networks. Chapter 5 Transport Protocols

Stop And Wait. ACK received; transmit frame 2 CS 455 3

Prefix AggregaNon. Company X and Company Y connect to the same ISP, and they are assigned the prefixes:

Names & Addresses. Names & Addresses. Hop-by-Hop Packet Forwarding. Longest-Prefix-Match Forwarding. Longest-Prefix-Match Forwarding

CSE 473 Introduction to Computer Networks. Exam 2 Solutions. Your name: 10/31/2013

Data Communications & Networks. Session 3 Main Theme Data Encoding and Transmission. Dr. Jean-Claude Franchitti

Computer Networks. Data Link Layer

Architecture and Performance of the Internet

COMP 361 Computer Communications Networks. Fall Semester Midterm Examination

First Midterm for ECE374 02/25/15 Solution!!

Lecture 15: Congestion Control. CSE 123: Computer Networks Stefan Savage

Transport Layer Protocols

Final Exam. Route Computation: One reason why link state routing is preferable to distance vector style routing.

TCP Flow Control. TCP Receiver Window. Sliding Window. Computer Networks. Lecture 30: Flow Control, Reliable Delivery

TCP in Wireless Mobile Networks

Data Link Layer(1) Principal service: Transferring data from the network layer of the source machine to the one of the destination machine

>>> SOLUTIONS <<< c) The OSI Reference Model has two additional layers. Where are these layers in the stack and what services do they provide?

Homework 2 assignment for ECE374 Posted: 02/21/14 Due: 02/28/14

Advanced Computer Networks Project 2: File Transfer Application

TCP over Multi-hop Wireless Networks * Overview of Transmission Control Protocol / Internet Protocol (TCP/IP) Internet Protocol (IP)

Data Link Layer. Flow Control. Flow Control

Transport Layer and Data Center TCP

Answer: that dprop equals dtrans. seconds. a) d prop. b) d trans

Outline. TCP connection setup/data transfer Computer Networking. TCP Reliability. Congestion sources and collapse. Congestion control basics

First Midterm for ECE374 03/24/11 Solution!!

Mathematical Modelling of Computer Networks: Part II. Module 1: Network Coding

Computer Networks - CS132/EECS148 - Spring

Based on Computer Networking, 4 th Edition by Kurose and Ross

Data Networks Summer 2007 Homework #3

A Transport Protocol for Multimedia Wireless Sensor Networks

Introduction to LAN/WAN. Network Layer

B-2 Analyzing TCP/IP Networks with Wireshark. Ray Tompkins Founder of Gearbit

TCP and Wireless Networks Classical Approaches Optimizations TCP for 2.5G/3G Systems. Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme

Congestions and Control Mechanisms n Wired and Wireless Networks

COMP 3331/9331: Computer Networks and Applications. Lab Exercise 3: TCP and UDP (Solutions)

Ethernet. Ethernet. Network Devices

Improving the Performance of TCP Using Window Adjustment Procedure and Bandwidth Estimation

ICOM : Computer Networks Chapter 6: The Transport Layer. By Dr Yi Qian Department of Electronic and Computer Engineering Fall 2006 UPRM

Access Control: Firewalls (1)

TCP, Active Queue Management and QoS

Congestion Control Overview

IP - The Internet Protocol

EKSAMEN / EXAM TTM

2 TCP-like Design. Answer

Mobile Computing/ Mobile Networks

Mobile Communications Chapter 9: Mobile Transport Layer

EINDHOVEN UNIVERSITY OF TECHNOLOGY Department of Mathematics and Computer Science

How do I get to

EITF25 Internet Techniques and Applications L5: Wide Area Networks (WAN) Stefan Höst

The present and the future of TCP/IP

LANs. Local Area Networks. via the Media Access Control (MAC) SubLayer. Networks: Local Area Networks

Internet structure: network of networks

Sources: Chapter 6 from. Computer Networking: A Top-Down Approach Featuring the Internet, by Kurose and Ross

Simulation-Based Comparisons of Solutions for TCP Packet Reordering in Wireless Network

0,2 D(0) A(1) D(1) 1,3 D(2) 0,2 D(0) A(1) D(1) 1,3 D(2) D(3) D(3) D(1) D(1) A(4) D(2) 4,6 D(3) A(4) 4,6 GO BACK 3 SELECTIVE REJECT WINDOW SLIDES

TCP for Wireless Networks

15-441: Computer Networks Homework 2 Solution

Communication Networks MAP-TELE 2012/13

Lecture Computer Networks

Internet Packets. Forwarding Datagrams

Computer Networks UDP and TCP

CS551 End-to-End Internet Packet Dynamics [Paxson99b]

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

Introduction. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross

Visualizations and Correlations in Troubleshooting

Solving complex performance problems in TCP/IP and SNA environments.

RARP: Reverse Address Resolution Protocol

The Problem with TCP. Overcoming TCP s Drawbacks

Congestion Control Review Computer Networking. Resource Management Approaches. Traffic and Resource Management. What is congestion control?

Operating Systems and Networks Sample Solution 1

TCP/IP Optimization for Wide Area Storage Networks. Dr. Joseph L White Juniper Networks

Routing in packet-switching networks

1. The subnet must prevent additional packets from entering the congested region until those already present can be processed.

AN IMPROVED SNOOP FOR TCP RENO AND TCP SACK IN WIRED-CUM- WIRELESS NETWORKS

Transport layer issues in ad hoc wireless networks Dmitrij Lagutin,

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

An enhanced TCP mechanism Fast-TCP in IP networks with wireless links

Ethereal: Getting Started

Delay, loss, layered architectures. packets queue in router buffers. packets queueing (delay)

How To Design A Layered Network In A Computer Network

Final exam review, Fall 2005 FSU (CIS-5357) Network Security

First Midterm for ECE374 03/09/12 Solution!!

[Prof. Rupesh G Vaishnav] Page 1

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

VoIP QoS. Version 1.0. September 4, AdvancedVoIP.com. Phone:

Final for ECE374 05/06/13 Solution!!

A study of Skype over IEEE networks: voice quality and bandwidth usage

CS640: Introduction to Computer Networks. Applications FTP: The File Transfer Protocol

A Survey on Congestion Control Mechanisms for Performance Improvement of TCP

Digital Audio and Video Data

La couche transport dans l'internet (la suite TCP/IP)

Multipath TCP in Practice (Work in Progress) Mark Handley Damon Wischik Costin Raiciu Alan Ford

Professor: Ian Foster TAs: Xuehai Zhang, Yong Zhao. Winter Quarter.

Transcription:

Data Communications & Networks Session 6 Main Theme Reliable Data Transfer Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Adapted from course textbook resources Computer Networking: A Top-Down Approach, 5/E Copyright 1996-2009 J.F. Kurose and K.W. Ross, All Rights Reserved 1 Agenda 11 Session Session Overview Overview 22 Reliable Reliable Data Data Transfer Transfer 33 Summary Summary and and Conclusion Conclusion 2

What is the class about? Course description and syllabus:» http://www.nyu.edu/classes/jcf/g22.2262-001/» http://www.cs.nyu.edu/courses/spring10/g22.2262-001/index.html Textbooks:» Computer Networking: A Top-Down Approach (5 th Edition) James F. Kurose, Keith W. Ross Addison Wesley ISBN-10: 0136079679, ISBN-13: 978-0136079675, 5th Edition (03/09) 3 Course Overview Computer Networks and the Internet Application Layer Fundamental Data Structures: queues, ring buffers, finite state machines Data Encoding and Transmission Local Area Networks and Data Link Control Wireless Communications Packet Switching OSI and Internet Protocol Architecture Congestion Control and Flow Control Methods Internet Protocols (IP, ARP, UDP, TCP) Network (packet) Routing Algorithms (OSPF, Distance Vector) IP Multicast Sockets 4

Reliable Data Transfer Session in Brief Principles of Reliable Data Transfer Reliable Data Transfer: Getting Started Reliable Data Transfer: Operational Details Other Reliable Data Transfer Protocols Conclusion 5 Icons / Metaphors Information Common Realization Knowledge/Competency Pattern Governance Alignment Solution Approach 6 6

Agenda 11 Session Overview 22 Reliable Data Transfer 33 Summary and Conclusion 7 Reliable Data Transfer Session in Brief Principles of Reliable Data Transfer Reliable Data Transfer: Getting Started Reliable Data Transfer: Operational Details Other Reliable Data Transfer Protocols 8

Principles of Reliable Data Transfer Important in app., transport, link layers Top-10 list of important networking topics! Characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) 9 Reliable Data Transfer Session in Brief Principles of Reliable Data Transfer Reliable Data Transfer: Getting Started Reliable Data Transfer: Operational Details Other Reliable Data Transfer Protocols 10

Reliable Data Transfer: Getting Started rdt_send(): called from above, (e.g., by app.). Passed data to deliver to receiver upper layer deliver_data(): called by rdt to deliver data to upper send side receive side udt_send(): called by rdt, to transfer packet over unreliable channel to receiver rdt_rcv(): called when packet arrives on rcv-side of channel 11 Reliable Data Transfer: Getting Started We ll: Incrementally develop sender, receiver sides of reliable data transfer protocol (rdt) Consider only unidirectional data transfer But control info will flow on both directions! Use finite state machines (FSM) to specify sender, receiver state: when in this state next state uniquely determined by next event state 1 event causing state transition actions taken on state transition event actions state 2 12

Reliable Data Transfer Session in Brief Principles of Reliable Data Transfer Reliable Data Transfer: Getting Started Reliable Data Transfer: Operational Details Other Reliable Data Transfer Protocols 13 Rdt1.0 - Reliable Transfer Over a Reliable Channel Underlying channel perfectly reliable No bit errors No loss of packets Separate FSMs for sender, receiver: Sender sends data into underlying channel Receiver read data from underlying channel call from above rdt_send(data) packet = make_pkt(data) udt_send(packet) call from below rdt_rcv(packet) extract (packet,data) deliver_data(data) sender receiver 14

Rdt2.0: Channel with Bit Errors Underlying channel may flip bits in packet Checksum to detect bit errors The question: how to recover from errors: Acknowledgements (ACKs): receiver explicitly tells sender that pkt received OK Negative acknowledgements (NAKs): receiver explicitly tells sender that pkt had errors Sender retransmits pkt on receipt of NAK New mechanisms in rdt2.0 (beyond rdt1.0): Error detection Receiver feedback: control msgs (ACK,NAK) rcvr->sender 15 Rdt2.0: FSM Specification rdt_send(data) snkpkt = make_pkt(data, checksum) call from above isack(rcvpkt) sender ACK or NAK isnak(rcvpkt) receiver corrupt(rcvpkt) udt_send(nak) call from below notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ack) 16

Rdt2.0: Operation with No Error rdt_send(data) snkpkt = make_pkt(data, checksum) call from above ACK or NAK isack(rcvpkt) isnak(rcvpkt) corrupt(rcvpkt) udt_send(nak) call from below notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ack) 17 Rdt2.0: Error Scenario rdt_send(data) snkpkt = make_pkt(data, checksum) call from above isack(rcvpkt) ACK or NAK isnak(rcvpkt) corrupt(rcvpkt) udt_send(nak) call from below notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ack) 18

Rdt 2.0 Has a Fatal Flaw! What happens if ACK/NAK corrupted? Sender doesn t know what happened at receiver! Can t just retransmit: possible duplicate Handling duplicates: Sender retransmits current pkt if ACK/NAK garbled Sender adds sequence number to each pkt Receiver discards (doesn t deliver up) duplicate pkt stop and wait Sender sends one packet, then waits for receiver response 19 Rdt2.1: Sender Handles Garbled ACK/NAKs rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isack(rcvpkt) ( corrupt(rcvpkt) isnak(rcvpkt) ) rdt_send(data) sndpkt = make_pkt(0, data, checksum) call 0 from above ACK or NAK 1 ACK or NAK 0 ( corrupt(rcvpkt) isnak(rcvpkt) ) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isack(rcvpkt) call 1 from above rdt_send(data) sndpkt = make_pkt(1, data, checksum) 20

Rdt2.1: Receiver Handles Garbled ACK/NAKs notcorrupt(rcvpkt) && has_seq0(rcvpkt) (corrupt(rcvpkt) sndpkt = make_pkt(nak, chksum) not corrupt(rcvpkt) && has_seq1(rcvpkt) sndpkt = make_pkt(ack, chksum) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ack, chksum) 0 from below 1 from below notcorrupt(rcvpkt) && has_seq1(rcvpkt) (corrupt(rcvpkt) sndpkt = make_pkt(nak, chksum) not corrupt(rcvpkt) && has_seq0(rcvpkt) sndpkt = make_pkt(ack, chksum) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ack, chksum) 21 Rdt 2.1: Discussion Sender: Seq # added to pkt Two seq. # s (0,1) will suffice. Why? Must check if received ACK/NAK corrupted Twice as many states» state must remember whether current pkt has 0 or 1 seq. # Receiver: Must check if received packet is duplicate» State indicates whether 0 or 1 is expected pkt seq # Note: receiver can not know if its last ACK/NAK received OK at sender 22

Rdt2.2: A NAK-Free Protocol Same functionality as rdt2.1, using ACKs only Instead of NAK, receiver sends ACK for last pkt received OK Receiver must explicitly include seq # of pkt being ACKed Duplicate ACK at sender results in same action as NAK: retransmit current pkt 23 Rdt2.2: Sender, Receiver Fragments (corrupt(rcvpkt) has_seq1(rcvpkt)) rdt_send(data) sndpkt = make_pkt(0, data, checksum) call 0 from above 0 from below ACK 0 sender FSM fragment receiver FSM fragment ( corrupt(rcvpkt) isack(rcvpkt,1) ) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isack(rcvpkt,0) notcorrupt(rcvpkt) && has_seq1(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ack1, chksum) 24

Rdt 3.0: Channels with Errors and Loss New Assumption: Underlying channel can also lose packets (data or ACKs)» checksum, seq. #, ACKs, retransmissions will be of help, but not enough Approach: sender waits reasonable amount of time for ACK Retransmits if no ACK received in this time If pkt (or ACK) just delayed (not lost):» Retransmission will be duplicate, but use of seq. # s already handles this» Receiver must specify seq # of pkt being ACKed Requires countdown timer 25 Rdt3.0: Sender rdt_rcv(rcvpkt) call 0from above rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isack(rcvpkt,1) stop_timer timeout start_timer ( corrupt(rcvpkt) isack(rcvpkt,0) ) rdt_send(data) sndpkt = make_pkt(0, data, checksum) start_timer Wait for ACK1 Wait for ACK0 call 1 from above rdt_send(data) sndpkt = make_pkt(1, data, checksum) start_timer ( corrupt(rcvpkt) isack(rcvpkt,1) ) timeout start_timer rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isack(rcvpkt,0) stop_timer rdt_rcv(rcvpkt) 26

Rdt3.0 in Action 27 Rdt3.0 in Action 28

Performance of Rdt 3.0 Rdt3.0 works, but performance stinks Example: 1 Gbps link, 15 ms e-e prop. delay, 1KB packet: T transmit = L (packet length in bits) R (transmission rate, bps) = 8kb/pkt 10**9 b/sec = 8 microsec» U sender : utilization fraction of time sender busy sending U L / R.008 sender = = 0.00027 RTT + L / R = 30.008 microsec d» 1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link» network protocol limits use of physical resources! 29 Rdt 3.0: Stop-and-Wait Operation first packet bit transmitted, t = 0 last packet bit transmitted, t = L / R sender receiver RTT first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R U sender = L / R RTT + L / R =.008 30.008 = 0.00027 microsec d 30

Reliable Data Transfer Session in Brief Principles of Reliable Data Transfer Reliable Data Transfer: Getting Started Reliable Data Transfer: Operational Details Other Reliable Data Transfer Protocols Conclusion 31 Pipelined Protocols Pipelining: sender allows multiple, in-flight, yet-tobe-acknowledged pkts Range of sequence numbers must be increased Buffering at sender and/or receiver Two generic forms of pipelined protocols: go-back-n, selective repeat 32

Pipelining: Increased Utilization first packet bit transmitted, t = 0 last bit transmitted, t = L / R sender receiver RTT ACK arrives, send next packet, t = RTT + L / R first packet bit arrives last packet bit arrives, send ACK last bit of 2 nd packet arrives, send ACK last bit of 3 rd packet arrives, send ACK U sender = 3 * L / R RTT + L / R =.024 30.008 Increase utilization by a factor of 3! = 0.0008 microsecon d 33 Go-Back-N Sender: k-bit seq # in pkt header window of up to N, consecutive unack ed pkts allowed ACK(n): ACKs all pkts up to, including seq # n - cumulative ACK May receive duplicate ACKs (see receiver) Timer for each in-flight pkt timeout(n): retransmit pkt n and all higher seq # pkts in window 34

GBN: Sender Extended FSM rdt_send(data) base=1 nextseqnum=1 rdt_rcv(rcvpkt) && corrupt(rcvpkt) 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) timeout start_timer Wait udt_send(sndpkt[base]) udt_send(sndpkt[base+1]) udt_send(sndpkt[nextseqnum-1]) notcorrupt(rcvpkt) base = getacknum(rcvpkt)+1 If (base == nextseqnum) stop_timer else start_timer 35 GBN: Receiver Extended FSM default expectedseqnum=1 Wait sndpkt = make_pkt(expectedseqnum,ack,chksum) rdt_rcv(rcvpkt) && notcurrupt(rcvpkt) && hasseqnum(rcvpkt,expectedseqnum) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(expectedseqnum,ack,chksum) expectedseqnum++ ACK-only: always send ACK for correctly-received pkt with highest in-order seq # May generate duplicate ACKs Need only remember expectedseqnum Out-of-order pkt: Discard (don t buffer) -> no receiver buffering! Re-ACK pkt with highest in-order seq # 36

GBN In Action 37 Selective Repeat Receiver individually acknowledges all correctly received pkts Buffers pkts, as needed, for eventual in-order delivery to upper layer Sender only resends pkts for which ACK not received Sender timer for each unacked pkt Sender window N consecutive seq # s Again limits seq #s of sent, unacked pkts 38

Selective Repeat: Sender, Receiver Windows 39 Selective Repeat sender Data from above: If next available seq # in window, send pkt Timeout(n): Resend pkt n, restart timer ACK(n) in [sendbase,sendbase+n]: Mark pkt n as received If n smallest unacked pkt, advance window base to next unacked seq # receiver Pkt n in [rcvbase, rcvbase+n- 1] Send ACK(n) Out-of-order: buffer In-order: deliver (also deliver buffered, inorder pkts), advance window to next not-yetreceived pkt Pkt n in [rcvbase-n,rcvbase-1] ACK(n) Otherwise: Ignore 40

Selective Repeat in Action 41 Selective Repeat: Dilemma Example: Seq # s: 0, 1, 2, 3 Window size=3 Receiver sees no difference in two scenarios! Incorrectly passes duplicate data as new in (a) Q: what relationship between seq # size and window size? 42

Agenda 11 Session Overview 22 Reliable Data Transfer 33 Summary and Conclusion 43 Summary Principles of Reliable Data Transfer Reliable Data Transfer: Getting Started Reliable Data Transfer: Operational Details Other Reliable Data Transfer Protocols 44

Assignments & Readings Readings» Chapter 3 Assignment #4» Due March 25 2010 45 Next Session: Networks - Part I 46