Last Time. Internet in a Day Day 2 of 1. Today: TCP and Apps

Similar documents
416 Distributed Systems. Networks review; Day 2 of 2 Fate sharing, e2e principle And start of RPC Jan 10, 2018

Distributed Systems /640

416 Distributed Systems. Networks review; Day 2 of 2 And start of RPC Jan 13, 2016

Last Time Distributed Systems. Goal 1: Survivability. Goals [Clark88] Fate Sharing. Today s Lecture

CS 640: Introduction to Computer Networks. Today s Lecture. Page 1

CSC 4900 Computer Networks: End-to-End Design

CS 4390 Computer Networks. Transport Services and Protocols

Page # Last Time. Lecture 2 Protocol Stacks and Layering. Today s Lecture. Why protocols and layering? What is a Protocol.

Lecture 2 Protocol Stacks. Last Tuesday

CMSC 322 Computer Networks Applications and End-To- End

The Transmission Control Protocol (TCP)

Module 2 Overview of Computer Networks

Module 2 Overview of. Computer Networks

CS 43: Computer Networks. 15: Transport Layer & UDP October 5, 2018

CSEN 503 Introduction to Communication Networks. Mervat AbuElkheir Hana Medhat Ayman Dayf. ** Slides are attributed to J. F.

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

ETSF10 Internet Protocols Transport Layer Protocols

COSC4377. Useful Linux Tool: screen

QUIZ: Longest Matching Prefix

Chapter 2 Application Layer. Lecture 4: principles of network applications. Computer Networking: A Top Down Approach

NWEN 243. Networked Applications. Layer 4 TCP and UDP

CS457 Transport Protocols. CS 457 Fall 2014

Lecture 2 Communication services The Trasport Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

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

416 Distributed Systems. Networks review; Day 1 of 2 Jan 5 + 8, 2018

ECE 650 Systems Programming & Engineering. Spring 2018

Chapter 3: Transport Layer Part A

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

CSC 401 Data and Computer Communications Networks

Lecture 5. Transport Layer. Transport Layer 1-1

Lecture 11. Transport Layer (cont d) Transport Layer 1

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

Transport layer Internet layer

CSC 4900 Computer Networks: Transport Layer

Lecture 2: Internet Architecture

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

Chapter 3: Transport Layer

CS4700/5700: Network fundamentals

Different Layers Lecture 20

CMSC 332 Computer Networks Transport Layer

Lecture 9: Transpor Layer Overview and UDP

CSC358 Week 4. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Lecture 2: Layering & End-to-End

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

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

EE 122: IP Forwarding and Transport Protocols

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

Introduction to Networks and the Internet

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

4.0.1 CHAPTER INTRODUCTION

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 7

CS 326: Operating Systems. Networking. Lecture 17

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

CSCD 330 Network Programming

Computer Communication Networks Midterm Review

MIDTERM EXAMINATION #2 OPERATING SYSTEM CONCEPTS U N I V E R S I T Y O F W I N D S O R S C H O O L O F C O M P U T E R S C I E N C E

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

CS4700/CS5700 Fundamentals of Computer Networks

NWEN 243. Networked Applications. Transport layer and application layer

User Datagram Protocol

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

Goal and A sample Network App

Outline. Internet. Router. Network Model. Internet Protocol (IP) Design Principles

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

Transport Layer. Chapter 3: Transport Layer

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

CS 457 Multimedia Applications. Fall 2014

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

Chapter 3 Transport Layer

CSE 461 Module 10. Introduction to the Transport Layer

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

Chapter III: Transport Layer

OSI Transport Layer. objectives

NT1210 Introduction to Networking. Unit 10

TDTS06: Computer Networks

Input ports, switching fabric, output ports Switching via memory, bus, crossbar Queueing, head-of-line blocking

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

CS 3516: Advanced Computer Networks

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

IP Packet Switching. Goals of Todayʼs Lecture. Simple Network: Nodes and a Link. Connectivity Links and nodes Circuit switching Packet switching

UNIT IV -- TRANSPORT LAYER

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

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

Intro to LAN/WAN. Transport Layer

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

Announcement. Homework 1 due last night, how is that? Will discuss some problems in the lecture next week

PLEASE READ CAREFULLY BEFORE YOU START

CS 43: Computer Networks. 19: TCP Flow and Congestion Control October 31, Nov 2, 2018

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

ECE 333: Introduction to Communication Networks Fall 2001

Links Reading: Chapter 2. Goals of Todayʼs Lecture. Message, Segment, Packet, and Frame

CSE 123A Computer Networks

CS4700/CS5700 Fundaments of Computer Networks

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

1. What is a Computer Network? interconnected collection of autonomous computers connected by a communication technology

UDP, TCP, IP multicast

Introduction to the Application Layer. Computer Networks Term B14

CS519: Computer Networks. Lecture 5, Part 1: Mar 3, 2004 Transport: UDP/TCP demux and flow control / sequencing

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

Transcription:

Internet in a Day Day 2 of 1 Carnegie Mellon University 15-440, Distributed Systems Last Time Modularity, Layering, and Decomposition Example: UDP layered on top of IP to provide application demux ( ports ) Resource sharing and isolation Statistical multiplexing - packet switching Dealing with heterogenity IP narrow waist -- allows many apps, many network technologies IP standard -- allows many impls, same proto Today: TCP and Apps Models to reason about network and system behavior Fail-stop, fail-stutter, byzantine failures Sync/Async communication model etc. Remember from last time... IP service model: best-effort Can drop, mangle, re-order, delay packets Easy model to provide (imposes few requirements on underlying layers--widely applicable) Less fun model to program to if you happen to need reliability, in-order, correct data

Design Question If you want reliability, etc. Where should you implement it? Option 1: Hop-by-hop Host Switch Switch Switch Switch Host Option 2: end-to-end Options Hop-by-hop: Have each switch/router along the path ensure that the packet gets to the next hop End-to-end: Have just the end-hosts ensure that the packet made it through What do we have to think about to make this decision?? A question Is hop-by-hop enough? [hint: What happens if a switch crashes? What if it s buggy and goofs up a packet?] The End-to-End Argument If you have to implement a function end-to-end anyway (e.g., because it requires the knowledge and help of the end-point host or application), don t implement it inside the communication system unless there s a compelling performance enhancement Further Reading: End-to-End Arguments in System Design. Saltzer, Reed, and Clark.

Keep in mind This is an engineering rule of thumb to be weighed against other design guidelines not a law But in practice, it s proved to be a nice way to think about things You may encounter situations where you can t (for whatever reason - technical, financial, political) implement things in the way the argument suggests. The real world can be an ugly place. :) Let s apply that to our question... Of where to do retransmissions What does e2e argument argue for here? TCP uses end-to-end retransmissions Can you think of times we might want to also implement hop-byhop retransmission? Hop-by-hop retransmission is cheaper and faster (count the packet-miles that are traveled) So maybe a very high-loss link -- like wireless! Your wireless card handles a few retransmissions on its own Rough view of TCP (This is a very incomplete view - take 15-441. :) Application View of TCP Time Source Data pkt ACKnowledgement Dest Remember socket API basics from 15-213 What TCP does: 1) Figures out which packets got through/lost 2) Figures out how fast to send packets to use all of the unused capacity, - But not more - And to share the link approx. equally with other senders

!"#$%&'()*'+,%-./"0'+1%-12%3 Client Server Blocking sockets socket socket open_clientfd Client / Server Session connect write read close Connection request EOF bind listen accept read write read open_listenfd What happens if an application write()s to a socket waaaaay faster than the network can send the data? TCP figures out how fast to send the data... And it builds up in the kernel socket buffers at the sender... and builds... until they fill. The next write() call blocks (by default). What s blocking? It suspends execution of the blocked thread until enough space frees up... close In contrast to UDP UDP doesn t figure out how fast to send data, or make it reliable, etc. So if you write() like mad to a UDP socket... It often silently disappears. Maybe if you re lucky the write() call will return an error. But no promises. take a breath.

Rehashing all of that... Questions to ponder TCP is layered on top of IP IP understands only the IP header The IP header has a protocol ID that gets set to TCP The TCP at the receiver understands how to parse the TCP information IP provides only best-effort service TCP adds value to IP by adding retransmission, in-order delivery, data checksums, etc., so that programmers don t have to re-implement the wheel every time. It also helps figure out how fast to send data. This is why TCP sockets can block from the app perspective. The e2e argument suggests that functionality that must be implemented end-to-end anyway (like retransmission in the case of dead routers) should probably be implemented only there -- unless there s a compelling perf. optimization What does the end-to-end argument say about where to implement encryption for confidentiality? If you have a whole file to transmit, how do you send it over the Internet? You break it into packets (packet-switched medium) TCP, roughly speaking, has the sender tell the receiver got it! every time it gets a packet. The sender uses this to make sure that the data s getting through. But by e2e, if you have to acknowledge the correct receipt of the entire file... why bother acknowledging the receipt of the individual packets??? Answers <break> 1) Encrypt end-to-end. A notable exception: The military sometimes uses hop-by-hop so that they can run unencrypted on physically secure links... so that they can monitor the traffic there. 2) This is a bit of a trick question -- it s not asking e2e vs in-network. :) The answer: Imagine the waste if you had to retransmit the entire file because one packet was lost. Ow.

Application Requirements Q: If you re building an application... How do you choose what transport service to use? A: That depends what the application s communication requirements are... Data loss What Transport Service Does an Application Need?! Some applications (e.g., audio) can tolerate some loss! Other applications (e.g., file transfer, telnet) require 100% reliable data transfer Bandwidth Timing! Some applications (e.g., Internet telephony, interactive games) require low delay to be effective! Some applications (e.g., multimedia) require a minimum amount of bandwidth to be effective! Other applications ( elastic apps ) will make use of whatever bandwidth they get 22 User Datagram Protocol(UDP): An Analogy Transmission Control Protocol (TCP): An Analogy UDP! Single socket to receive messages! No guarantee of delivery! Not necessarily in-order delivery! Datagram independent packets! Must address each packet Postal Mail! Single mailbox to receive letters! Unreliable!! Not necessarily in-order delivery! Letters sent independently! Must address each reply TCP! Reliable guarantee delivery! Byte stream in-order delivery! Connection-oriented single socket per connection! Setup connection followed by data transfer Telephone Call! Guaranteed delivery! In-order delivery! Connection-oriented! Setup connection followed by conversation Example UDP applications Multimedia, voice over IP Example TCP applications Web, Email, Telnet 23 24

Why not always use TCP? One lost packet! TCP provides more than UDP! Why not use it for everything??! A: Nothing comes for free...! 1) Connection setup (take on faith) -- TCP requires one round-trip time to setup the connection state before it can chat...! How long does it take, using TCP, to fix a lost packet?» At minimum, one round-trip time (2x the latency of the network)» That could be 100+ milliseconds!! If I guarantee in-order delivery, what happens if I lose one packet in a stream of packets? Packet # Time Delay, burst Time to retransmit lost packet Sent packets Received packets (delivered to application) 25 26 Design trade-off Transport Service Requirements of Common Applications Application Data loss Bandwidth Time Sensitive If you re building an app... Do you need everything TCP provides? If not: Can you deal with its drawbacks to take advantage of the subset of its features you need? If not: You re going to have to implement the ones you need on top of UDP Caveat: There are some libraries, protocols, etc., that can help provide a middle ground. Takes some looking around - they re not as standard as UDP and TCP. file transfer e-mail web documents real-time audio/ video stored audio/video interactive games financial apps no loss no loss no loss loss-tolerant loss-tolerant loss-tolerant no loss elastic elastic elastic audio: 5Kb-1Mb video:10kb-5mb same as above few Kbps elastic!interactions between layers are important.»persistent HTTP»encryption and compression»mpeg frame types. Loss & real-time video. no no no yes, 100 s msec yes, few secs yes, 100 s msec yes and no 28

Proj 1 and today s material You ll use UDP. Why? A1: The course staff is full of sadists who want you to do a lot of work. This is true in part: timeouts and retransmission are a core aspect of using the network. A2: The communication needed is very small, and you have to implement a lot of reliability stuff anyway to ensure that the work gets done... Honestly? This one seems to me like a middle ground. You might use TCP for other reasons (firewalls that block everything but TCP), or to avoid the need for the job ack part of the protocol. Or you might stick with UDP to reduce the overhead at the server.