Question. Reliable Transport: The Prequel. Don t parse my words too carefully. Don t be intimidated. Decisions and Their Principles.

Similar documents
Computer Networks. Sándor Laki ELTE-Ericsson Communication Networks Laboratory

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

Internet Design: Goals and Principles

Page 1. Goals for Today" Discussion" Example: Reliable File Transfer" CS162 Operating Systems and Systems Programming Lecture 11

Goal of Today s Lecture. EE 122: Designing IP. The Internet Hourglass. Our Story So Far (Context) Our Story So Far (Context), Con t

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due NOW!

NWEN 243. Networked Applications. Layer 4 TCP and UDP

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 21: Network Protocols (and 2 Phase Commit)

Reliable Transport I: Concepts and TCP Protocol

Lecture 7: Flow Control"

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture)

TCP : Fundamentals of Computer Networks Bill Nace

Goals of Today s Lecture! Congestion Control! Course So Far.! Congestion Control Overview! It s Not Just The Sender & Receiver! Congestion is Natural!

TCP Performance. EE 122: Intro to Communication Networks. Fall 2006 (MW 4-5:30 in Donner 155) Vern Paxson TAs: Dilip Antony Joseph and Sukun Kim

EE 122: IP Forwarding and Transport Protocols

The Transmission Control Protocol (TCP)

Announcements. IP Forwarding & Transport Protocols. Goals of Today s Lecture. Are 32-bit Addresses Enough? Summary of IP Addressing.

Basic Reliable Transport Protocols

Probability, Preview, and Principles

The Transport Layer Reliability

Reliable Transport : Fundamentals of Computer Networks Bill Nace

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Page 1. Goals for Today" Placing Network Functionality" Basic Observation" CS162 Operating Systems and Systems Programming Lecture 15

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 11, 2018

Computer Networking. Reliable Transport. Reliable Transport. Principles of reliable data transfer. Reliable data transfer. Elements of Procedure

Communications Software. CSE 123b. CSE 123b. Spring Lecture 3: Reliable Communications. Stefan Savage. Some slides couresty David Wetherall

More Routing. EE122 Fall 2012 Scott Shenker

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

CS 268: Internet Architecture & E2E Arguments. Today s Agenda. Scott Shenker and Ion Stoica (Fall, 2010) Design goals.

Page 1. Review: Internet Protocol Stack. Transport Layer Services. Design Issue EEC173B/ECS152C. Review: TCP

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

Page 1. Goals for Today" What Is A Protocol?" CS162 Operating Systems and Systems Programming Lecture 10. Protocols, Layering and e2e Argument"

CS4700/CS5700 Fundamentals of Computer Networks

Principles of Reliable Data Transfer

UNIT IV -- TRANSPORT LAYER

CSE/EE 461. Sliding Windows and ARQ. Last Time. This Time. We finished up the Network layer Internetworks (IP) Routing (DV/RIP, LS/OSPF)

Chapter 3: Transport Layer Part A

CSC 4900 Computer Networks: TCP

Connectionless and Connection-Oriented Protocols OSI Layer 4 Common feature: Multiplexing Using. The Transmission Control Protocol (TCP)

ECE697AA Lecture 3. Today s lecture

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Outline Computer Networking. Functionality Split. Transport Protocols

Reliable Transport I: Concepts and TCP Protocol

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

6.033 Lecture 12 3/16/09. Last time: network layer -- how to deliver a packet across a network of multiple links

CS 43: Computer Networks. 16: Reliable Data Transfer October 8, 2018

EECS 122, Lecture 19. Reliable Delivery. An Example. Improving over Stop & Wait. Picture of Go-back-n/Sliding Window. Send Window Maintenance

ECE 435 Network Engineering Lecture 10

TCP Service Model. Today s Lecture. TCP Support for Reliable Delivery. EE 122:TCP, Connection Setup, Reliability

Page 1. Review: Internet Protocol Stack. Transport Layer Services EEC173B/ECS152C. Review: TCP. Transport Layer: Connectionless Service

Internet transport-layer protocols. Transport services and protocols. Sending and receiving. Connection-oriented (TCP) Connection-oriented

Question 1 (6 points) Compare circuit-switching and packet-switching networks based on the following criteria:

Chapter 11 Data Link Control 11.1

CS457 Transport Protocols. CS 457 Fall 2014

Goals for Today s Class. EE 122: Networks & Protocols. What Global (non-digital) Communication Network Do You Use Every Day?

Communication Networks

User Datagram Protocol

Advanced Topics in Routing

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

CSCI-131 Networking: the End-to-End Layer. Rodrigo Fonseca March 12 th, 2013

Transport services and protocols. Chapter 3 outline. Internet transport-layer protocols Chapter 3 outline. Multiplexing/demultiplexing

Transport Layer Marcos Vieira

Correcting mistakes. TCP: Overview RFCs: 793, 1122, 1323, 2018, TCP seq. # s and ACKs. GBN in action. TCP segment structure

Outline Computer Networking. TCP slow start. TCP modeling. TCP details AIMD. Congestion Avoidance. Lecture 18 TCP Performance Peter Steenkiste

Congestion Control. Brighten Godfrey CS 538 January Based in part on slides by Ion Stoica

Lecture (11) OSI layer 4 protocols TCP/UDP protocols

Reliable Data Transfer

Networking Acronym Smorgasbord: , DVMRP, CBT, WFQ

Communication Networks

CRC. Implementation. Error control. Software schemes. Packet errors. Types of packet errors

Lecture 7: Flow & Media Access Control"

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

TCP: Flow and Error Control

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

CSC 8560 Computer Networks: TCP

Reliable Transport II: TCP and Congestion Control

Network Performance: Queuing

Lecture 5. Transport Layer. Transport Layer 1-1

CMPE150 Midterm Solutions

CS 3640: Introduction to Networks and Their Applications

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Lecture 15: Transport Layer Congestion Control

Chapter 3: Transport Layer

CSCD 330 Network Programming

CS43: Computer Networks Reliable Data Transfer. Kevin Webb Swarthmore College October 5, 2017

MPTCP: Design and Deployment. Day 11

CSC 401 Data and Computer Communications Networks

Outline. CS5984 Mobile Computing

CSE 123A Computer Networks

STEVEN R. BAGLEY PACKETS

Lixia Zhang M. I. T. Laboratory for Computer Science December 1985

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

Message, Segment, Packet, and Frame Link-layer services Encoding, framing, error detection, transmission control Error correction and flow control

CSC 4900 Computer Networks: Reliable Data Transport

Lecture 3: The Transport Layer: UDP and TCP

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

Stream Control Transmission Protocol

Applied Networks & Security

Transcription:

Question How many people have not yet participated? Reliable Transport: The Prequel EE122 Fall 2012 Scott Shenker http://inst.eecs.berkeley.edu/~ee122/ Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson and other colleagues at Princeton and UC Berkeley 1 2 Don t be intimidated. Wide spectrum of backgrounds But that s just a head start in context, not content When we get to the real algorithms, everyone will be on the same page Don t parse my words too carefully Networking is not a set of precise rules It is a state of mind. The principles of networking help you build scalable and robust systems But they don t provide a detailed instruction manual 3 4 Outline for Today Fate Sharing Course So Far Reliable Delivery Decisions and Their Principles How to break system into modules Dictated by Layering Where modules are implemented Dictated by End-to-End Principle Where state is stored Dictated by Fate-Sharing 5 6 1

Fate-Sharing Fate-Sharing Note that E2E principle relied on fate-sharing Invariants break only when endpoints themselves break Minimize dependence on other network elements This should also dictate placement of storage 8 General Principle: Fate-Sharing When storing state in a distributed system, colocate it with entities that rely on that state Only way failure can cause loss of the critical state is if the entity that cares about it also fails... in which case it doesn t matter Often argues for keeping network state at end hosts rather than inside routers In keeping with End-to-End principle E.g., packet-switching rather than circuit-switching E.g., NFS file handles, HTTP cookies A Cynical View of Distributed Systems A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable ---Leslie Lamport This is precisely what fate-sharing is trying to avoid.. 9 10 We Are In the Conceptual Phase The Course So Far Three phases to course: Basic concepts Making these concepts real Various topics The conceptual phase has three steps 12 2

First Step: Basic Decisions Packet Switching winner over circuit switching Second Step: Architectural Principles Layering Best-effort service model End-to-End Principle Fate-Sharing 13 14 Third Step: Design Challenges Let s go layer by layer Physical Datalink Network Transport Application What function does each layer need to implement? Two Layers We Don t Worry About Physical: Technology dependent Lots of possible solutions Not specific to the Internet Application: Application-dependent Lots of possible solutions 15 16 Datalink and Network Layers Both support best-effort delivery Datalink over local scope Network over global scope Transport Layer Provide reliable delivery over unreliable network Key challenge: scalable, robust routing How to direct packets to destination 17 18 3

We Only Have Two Design Challenges Routing: to be covered next week (+project 2) Reliable delivery: to be covered today (+project 1) You will then know everything you need to know Conceptually.. Lecture on missing pieces will complete picture Purpose of Today Understand reliable transport conceptually What are the fundamental aspects of reliable transport? The goal is not to understand TCP TCP involves lots of detailed mechanisms, covered later Ground rules for discussion: No mention of TCP No mention of detailed practical issues Focus only on ideal world of packets and links 19 20 Two Pedagogical Approaches 1. Understand why given algorithm works (textbook) 2. Understand the space of possible algorithms The first: you understand why the Internet works And get a job at Cisco The second: you could design the next Internet Or start the next Cisco... You Must Think For Yourself Today s lecture requires you to engage How would I design a reliable service? I will ask questions, want you to think about them If you think you already know this, you are wrong If you think you don t know enough, you are wrong If you think you can learn this asleep, you are wrong The second is what we do at Berkeley! 21 22 Best Effort Service Reliable Delivery Packets can be lost Packets can be corrupted Packets can be reordered Packets can be delayed Packets can be duplicated. How can you possibly make anything work with such a service model? 24 4

Making Best Effort Work Engineer network so that average case is decent No guarantees, but you must try. Reliable Transport Is Necessary Some app semantics involve reliable transport E.g., file transfer Engineer apps so they can tolerate the worst case They don t have to thrive, they just can t die How can we build a reliable transport service on top of an arbitrarily unreliable packet delivery? A classical case of architecting for flexibility Engineering for performance Internet enabled app innovation and competition Only the hardy survived, and doomsayers were ignored 25 A central challenge in bridging the gap between the abstractions application designers want the abstractions networks can easily support 26 Important Distinctions Functionality implemented in network Keep minimal (easy to build, broadly applicable) Functionality implemented in the application Keep minimal (easy to write) Restricted to application-specific functionality Functionality implemented in the network stack The shared networking code on the host This relieves burden from both app and network This is where reliability belongs Two Different Statements Applications need reliable service This means that the application writers should be able to assume this, to make their job easier The network must provide reliable service This contends that end hosts cannot implement this functionality, so the network must provide it Today we are making the first statement, and refuting the second 27 28 Challenge for Today Building a stack that supports reliable transfer So that individual applications don t need to deal with packet losses, etc. Fundamental Systems Question How to build reliable services over unreliable components File systems, databases, etc. Reliable transport is the simplest example of this 29 30 5

Four Goals For Reliable Transfer Correctness Timeliness Minimize time until data is transferred Start with transfer of a single packet We can later worry about larger files, but in the beginning it is cleaner to focus on this simple case Efficiency Would like to minimize use of bandwidth i.e., don t send too many packets Fairness How well does it play with others? 31 32 Correctness Condition? Packet is delivered to receiver. WRONG! What if network is partitioned? 33 34 Correctness Condition? Packet is delivered to receiver if and only if it was possible to deliver packet. WRONG! If the network is only available at one instant of time, only an Oracle would know when to send. 35 36 6

Correctness Condition? Resend packet if and only if the previous transmission was lost or corrupted WRONG! Impossible Coordinated Attack over an unreliable network Consider two cases: Packet delivered; all packets from receiver are dropped Packet dropped; all packets from receiver are dropped They are indistinguishable to sender Does it resend, or not? 37 38 Correctness Condition? Packet is always resent if the previous transmission was lost or corrupted. Packet may be resent at other times. We have correctness condition How do we achieve it? Note: This invariant gives us a simple criterion for deciding if an implementation is correct Efficiency and timeliness are separate criteria. 39 40 Two Choices for Corruption Have applications do integrity check Ignore it in transport protocol Do per-packet checksum Won t be perfectly reliable, still have app-level check So why do it? What does the E2E principle say? This is all implemented in the ends! But E2E reasoning about correctness still applies Solution v1 Send every packet as often and fast as you can. Definitely correct Optimal timeliness Infinitely bad efficiency Today, we will ignore corruption, treat it as loss 41 42 7

What s Missing? Feedback from receiver! If receiver does not respond, no way for sender to tell when to stop resending. Cannot achieve efficiency + correctness w/out feedback. Forms of Feedback ACK: Yes, I got the packet NACK: No, I did not get the packet When is NACK a natural idea? Corruption Ignore NACKs for rest of lecture. 43 44 Solution v2 Resend packet until you get an ACK And receiver resends ACKs until data flow stops Optimal timeliness Efficiency: how much bandwidth is wasted? ~ B x RTT ok for short latencies bad for long latencies Solution v3 Send packet Set a timer If receive ACK: done If no ACK by time timer expires, resend. Timeliness would argue for small timeout Efficiency would argue for larger timeout May want to increase timer each time you try May want to cap the number of retries 45 46 Have solved the single packet case Send packet Set timer If no ACK when timer goes off, resend packet And reset timer 5 Minute Break 47 48 8

Multiple Packets Service Model: reliable stream of packets Hand up contiguous block of packets to application Why not use single-packet solution? Only one packet in flight at any time Very poor timeliness (but very good efficiency) Use window-based approach Allow for W packets in-flight at any time (unack ed) Sliding Window implies W packets are contiguous Makes sense if window is related to receiver buffer (later) Window-based Algorithms See textbook or the web for animations. Will implement in project Very simple concept: Send W packets When one gets ACK ed, send the next packet in line Will consider several variations. But first. 49 50 How big should the window be? Windows serve three purposes Taking advantage of the bandwidth on the link Limiting the bandwidth used (congestion control) Limiting the amount of buffering needed at the receiver If we ignore all but the first goal, then we want to keep the sender always sending (in the ideal case) RTT: sending first packet until receiving first ACK Design Considerations Nature of feedback Detection of loss Response to loss Condition: RTT x B ~ W x Packet Size 51 52 Possible Feedback From Receiver Ideas? ACK Individual Packets Strengths: Know fate of each packet Impervious to reordering Simple window algorithm W independent single-packet algorithms When one finishes, grab next packet Weaknesses? Loss of ACK packet requires a retransmission 53 54 9

Cumulative ACK ACK the highest sequence number for which all previous packets have been received Implementations often send back next expected packet, but that s just a detail Strengths: Recovers from lost ACKs Weaknesses? Confused by reordering Incomplete information about which packets have arrived 55 Full Information List all packets that have been received Give highest cumulative ACK plus any additional packets Feasible if only small holes Strengths: As much information as you could hope for Resilient form of individual ACKs Weaknesses? Could require sizable overhead in bad cases 56 Detecting Loss If packet times out, assume it is lost. Loss with individual ACKs Assume packet 5 is lost, but no others How else can you detect loss? 57 Stream of ACKs will be: 1 2 3 4 6 7 8. 58 Loss with individual ACKs Could resend packet when k subsequent packets are received Response to loss: Resend missing packet Continue window based protocol Loss with full information Same story, except that the hole is explicit Stream of ACKs will be: Up to 1 Up to 2 Up to 3 Up to 4 Up to 4, plus 6 Up to 4, plus 6,7 Up to 4, plus 6,7,8. 59 60 10

Loss with full information Could resend packet when k subsequent packets are received Loss with cumulative ACKs Assume packet 5 is lost, but no others Response to loss: Resend missing packet Continue window based protocol 61 Stream of ACKs will be: 1 2 3 4 4 (when 6 arrives) 4 (when 7 arrives) 4 (when 8 arrives). 62 Loss with cumulative ACKs Duplicate ACKs are a sign of an isolated loss The lack of ACK progress means 5 hasn t been delivered The stream of ACKs means that some packets are being delivered Therefore, could trigger resend upon receiving k duplicate ACKs But response to loss is trickier. Loss with cumulative ACKs Two choices: Send missing packet and optimistically assume that subsequent packets have arrived i.e., increase W by the number of Dup ACKs Send missing packet, and wait for ACK Timeout-detected losses also problematic If packet 5 times out, packet 6 is about to time out also Do you resend both? Do you resend 5 and wait?. 63 64 Go-Back-N Simple algorithm (not advisable, but simple) Sliding window (only W contiguous packets) When a loss is detected by timeout, resend all W packets starting with loss Receiver discards out-of-order packets All the bad things best effort can do Packets can be lost Packets can be corrupted Packets can be reordered Packets can be delayed Packets can be duplicated 65 66 11

Effect of Reordering? Individual ACKs: not a problem Full information: not a problem Cumulative ACKs: create Dup ACKs Effect of Long Delays? Possible timeouts 67 68 Effect of Duplication? Produce Duplicate ACKs Could be confused for loss with cumulative ACKs But duplication is rare. Possible Design Full information ACKs Window-based, with retransmissions after: Timeout K subsequent ACKs This is correct, timely, efficient 69 70 Fairness? Adjust W based on losses. In a way that flows receive same shares Short version: Loss: cut W by 2 Successful receipt of window: W increased by 1 Summary Window-based flow control separates concerns Size of W: Nature of feedback: Response to loss: Can design each aspect relatively independently Can be correct, efficient, timely, and fair 71 72 12

Are We Done? There are other approaches. Alternate Strategy: Rateless Codes Use special encoding Receipt of any set of M packets allows you to recover file Where M is close to the size of the original file Receiver only sends ACK when M are received Sender keeps sending until receives ACK Timely, Correct How efficient is it? 73 74 The Paradox of Internet Traffic The majority of flows are short A few packets The majority of bytes are in long flows MB or more And this trend is accelerating Inefficiency The wasted bandwidth ~ BxRTT For long flows, this is small compared to total file For short flows, this is large compared to file But most of the bandwidth is in long flows! This is not a terrible idea 75 What is missing? 76 Next Lecture Routing 77 13