Distributed Systems /640

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

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

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

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

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

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

Design Considerations : Computer Networking. Outline

Internet Design: Big Picture

Announcements Computer Networking. What is the Objective of the Internet? Today s Lecture

CE693: Adv. Computer Networking

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

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

Introduction to Networks

Last Time. Lecture 2 Protocol Stacks and Layering. Today s Lecture. Why protocols and layering? Protocol and Service Levels. How to Design a Network?

CS 268: Computer Networking

15-744: Computer Networking. L-1 Intro to Computer Networks

Lecture 2 Protocol Stacks. Last Tuesday

Goal 0: Connecting Networks. Challenge 1: Address Formats. Challenge 2: Different Packet Sizes. Goals [Clark88]

Outline : Computer Networking. Objectives. Who s Who? Administrivia. Layering. L-1 Intro to Computer Networks

Design Considerations : Computer Networking. Outline. Challenge 1: Address Formats. Challenge. How to determine split of functionality

CSC 4900 Computer Networks: End-to-End Design

CE693: Adv. Computer Networking

CMSC 322 Computer Networks Applications and End-To- End

CE 443: Computer Networks

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

Module 2 Overview of Computer Networks

Module 2 Overview of. Computer Networks

Lecture 2: Links and Signaling

CS 4390 Computer Networks. Transport Services and Protocols

Computer Networks. Fall 2012 (M 6:15-9:00 in Jbarry 201B) Mirela Damian.

The Transmission Control Protocol (TCP)

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

CSC2209 Computer Networks

Network Reading Group

EE 122: IP Forwarding and Transport Protocols

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

TCP/IP THE TCP/IP ARCHITECTURE

User Datagram Protocol

COS 318: Internetworking

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

CSCD 330 Network Programming

CSE 123A Computer Networks

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

CS 678 Spring 2013 Network Architecture and Principles

Lecture 2: Internet Architecture

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

CS3600 SYSTEMS AND NETWORKS

Goal and A sample Network App

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

Peer entities. Protocol Layering. Protocols. Example

ECE 650 Systems Programming & Engineering. Spring 2018

Different Layers Lecture 20

CS 3516: Advanced Computer Networks

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

CS 268: Lecture 4 (Internet Architecture & E2E Arguments)

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

UNIT IV -- TRANSPORT LAYER

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

Week 2 / Paper 1. The Design Philosophy of the DARPA Internet Protocols

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

Lecture Overview : Computer Networking. Applications and Application-Layer Protocols. Client-Server Paradigm

Part 1: Introduction. Goal: Review of how the Internet works Overview

CS4700/5700: Network fundamentals

CS457 Transport Protocols. CS 457 Fall 2014

OSI Transport Layer. objectives

QUIZ: Longest Matching Prefix

CSCI Computer Networks

CS4700/CS5700 Fundaments of Computer Networks

CS4700/CS5700 Fundamentals of Computer Networks

Review of Previous Lecture

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

Internet Design Principles

u 1960s: ARPAnet - Defense Advanced Research Project l Research project into packet switching networks u 1970s: ARPA needed:

Welcome to: Computer Science 457 Networking and the Internet. Fall 2014 Dr. Joseph Gersch

Networking and Internetworking 1

CMPE 80N: Introduction to Networking and the Internet

Network and Security: Introduction

CSCD 330 Network Programming

Transport Layer. Chapter 3: Transport Layer

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

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

COSC4377. Useful Linux Tool: screen

4.0.1 CHAPTER INTRODUCTION

EEC-484/584 Computer Networks. Lecture 16. Wenbing Zhao

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Lecture 5. Transport Layer. Transport Layer 1-1

Introduction to the Application Layer. Computer Networks Term B14

Internet Architecture and Assumptions. David Andersen CMU Computer Science

EEC-484/584 Computer Networks

CSCI-GA Operating Systems. Networking. Hubertus Franke

Lecture 2: Layering & End-to-End

NT1210 Introduction to Networking. Unit 10

Chapter 3: Transport Layer Part A

TDTS21 Advanced Networking

Lecture 9: Transpor Layer Overview and UDP

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

Internet Design Principles and Architecture

Lecture-4. TCP/IP-Overview:

b) Diverse forms of physical connection - all sorts of wired connections, wireless connections, fiber optics, etc.

UDP, TCP, IP multicast

Transcription:

Distributed Systems 15-440/640 Fall 2018 3 Communication: The Internet in a Day (ctnd)

Announcements Recitations Tomorrow (9/5) Wean 7500 to go over the basics of Golang at 6pm and again at 7pm Prepare by going over the Tour of Go https://tour.golang.org In general: will be on Wednesday evenings Not every week Will be announced 2

Thursday s Lecture Network links and LANs Inter-network Communication Layering & Protocols Internet design Transport protocols Application design

Today s Lecture Network links and LANs Inter-network Communication Layering & Protocols Internet design Transport protocols Application design

Network Service Model What is the service model for inter-network? Defines what promises that the network gives for any transmission Defines what type of failures to expect best-effort Ethernet/Internet packets can get lost, etc. Development of failure models in DS design 5

Possible Failure models Fail-stop: When something goes wrong, the process stops / crashes / etc. Fail-slow or fail-stutter: Performance may vary on failures as well Byzantine: Anything that can go wrong, will. Including malicious entities taking over your computers and making them do whatever they want. These models are useful for proving things; The real world typically has a bit of everything. Deciding which model to use is important!

Fancier Network Service Models What if you want more? Performance guarantees (QoS) Reliability Corruption Lost packets Flow and congestion control Fragmentation In-order delivery Etc If network provides this reuse across applications How would you implement these? 7

What if the Data gets Corrupted? Problem: Data Corruption GET index.html GET inrex.html Internet Solution: Add a checksum 0,9 9 6,7, 2 8 1 X 4,5 7 1,2, 6 3 8

What if the Data gets Lost? Problem: Lost Data GET index.html Internet Solution: Timeout and Retransmit GET index.html Internet GET index.html GET index.html 9

What if the Data is Out of Order? Problem: Out of Order ml inde x.ht GET GET x.htindeml Solution: Add Sequence Numbers ml 4 inde 2 x.ht 3 GET 1 GET index.html 10

Networks [including end points] Implement Many Functions Link Multiplexing Routing Addressing/naming (locating peers) Reliability But note limitations: these Flow control can t turn a byzantine failure Fragmentation model into a fail-stop model! Etc. Where would you implement each function? 11

What is Layering? Modular approach to network functionality Example: Application Application-to-application channels Host-to-host connectivity Link hardware 12

What is Layering? User A Peer Layer Peer Layer User B Application Transport Network Link Host Host Modular approach to network functionality 13

Layering Characteristics Each layer relies on services from layer below and exports services to layer above Interface defines interaction with peer on other hosts Protocols define: Interface to higher layers (API) Interface to peer (syntax & semantics) Actions taken on receipt of a messages Format and order of messages Error handling, termination, ordering of requests, etc. Hides implementation - layers can change without disturbing other layers (black box) 14

Today s Lecture Network links and LANs Inter-network Communication Layering & Protocols Internet design Transport protocols Application design

Goals [Clark88] 0 Connect existing networks initially ARPANET and ARPA packet radio network 1. Survivability ensure communication service even in the presence of network and router failures 2. Support multiple types of services 3. Must accommodate a variety of networks 4. Allow distributed management 5. Allow host attachment with a low level of effort 6. Be cost effective 7. Allow resource accountability 16

Gateway Alternatives Translation Difficulty in dealing with different features supported by networks Scales poorly with number of network types (N^2 conversions) Standardization IP over everything (Design Principle 1) Minimal assumptions about network Hourglass design 17

Goal 1: Survivability If network is disrupted and reconfigured Communicating entities should not care! No higher-level state reconfiguration How to achieve such reliability? Where can communication state be stored? Failure handing Net Engineering Switches Host trust Network Host Replication Tough Maintain state Less Fate sharing Simple Stateless More 18

Fate Sharing Connection State No State State Lose state information for an entity if and only if the entity itself is lost. Examples: OK to lose TCP state if one endpoint crashes NOT okay to lose if an intermediate router reboots Tradeoffs Survivability: Heterogeneous network less information available to end hosts and Internet level recovery mechanisms Trust: must trust endpoints more 19

End-to-End Argument Deals with where to place functionality Inside the network (in switching elements) At the edges 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 Key motivation for split of functionality between TCP,UPD and IP Further Reading: End-to-End Arguments in System Design. Saltzer, Reed, and Clark. 20

IP Layering Relatively simple Application Transport Network Link Physical Host Bridge/Switch Router/Gateway Host 21

The Internet Protocol Suite FTP HTTP NV TCP TFTP Applications UDP TCP UDP Waist IP Data Link NET1 NET2 NETn Physical The Hourglass Model The waist facilitates interoperability What s the disadvantage of the IP waist? What creates the edges in the tree above? 22

Layer Encapsulation User A User B Get index.html Connection ID Source/Destination Link Address 23

Multiplexing and Demultiplexing There may be multiple implementations of each layer. How does the receiver know what version of a layer to use? Each header includes a demultiplexing field that is used to identify the next layer. Filled in by the sender Used by the receiver TCP TCP IP IP Recall: IP header V/HL TOS ID TTL Length Flags/Offset Prot. H. Checksum Source IP address Network Type Field IP Protocol Field TCP/UDP Port Number Destination IP address Options.. 24

Today s Lecture Network links and LANs Inter-network Communication Layering & Protocols Internet design Transport protocols Application design

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 26

Transport Protocols & Types of Service TCP vs. UDP Elastic apps that need reliability: remote login or email Inelastic, loss-tolerant apps: real-time voice or video Others in between, or with stronger requirements Biggest cause of delay variation: reliable delivery Today s net: ~100ms RTT Reliable delivery can add seconds. Original Internet model: TCP/IP one layer First app was remote login But then came debugging, voice, etc. These differences caused the layer split, added UDP 27

Transport Protocols UDP provides just integrity and demux TCP adds Connection-oriented Reliable Ordered Point-to-point Byte-stream Full duplex Flow and congestion controlled 28

User Datagram Protocol (UDP): 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 Postal Mail Single mailbox to receive letters messages Unreliable Not necessarily in-order delivery Letters sentisindependently Each letter independent Must address each letter reply Example UDP applications Multimedia, voice over IP 29

Transmission Control Protocol (TCP): An Analogy 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 TCP applications Web, Email, Telnet 30

Rough view of TCP (This is a very incomplete view - take 15-441. :) Source Time Data pkt Dest ACKnowledgement 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 31

Questions to ponder 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. If you acknowledge the correct receipt of the entire file (e.g. due to e2e argument)... why bother acknowledging the receipt of the individual packets??? The answer: Imagine the waste if you had to retransmit the entire file because one packet was lost. Ow. 32

Today s Lecture Network links and LANs Inter-network Communication Layering & Protocols Internet design Transport protocols Application design

Today s Lecture Network links and LANs Inter-network Communication Layering & Protocols Internet design Transport protocols Application design

Client-Server Paradigm Typical network app has two pieces: client and server Client: Initiates contact with server ( speaks first ) Typically requests service from server, For Web, client is implemented in browser; for e-mail, in mail reader application transport network data link physical request Server: Provides requested service to client e.g., Web server sends requested Web page, mail server delivers e-mail reply application transport network data link physical 35

Socket API Operation Overview Client Server socket socket bind open_listenfd open_clientfd listen connect Client / Server Session Connection request accept write read read write close EOF read close 36

What Service Does an Application Need? Data loss Some apps (e.g., audio) can tolerate some loss Other apps (e.g., file transfer, telnet) require 100% reliable data transfer Timing Some apps (e.g., Internet telephony, interactive games) require low delay to be effective Bandwidth Some apps (e.g., multimedia) require minimum amount of bandwidth to be effective Other apps ( elastic apps ) make use of whatever bandwidth they get 37

Transport Service Requirements of Common Apps Application file transfer e-mail web documents interactive audio/video non-interactive audio/video interactive games financial apps Data loss Bandwidth Time Sensitive no loss no loss no loss loss-tolerant (often) loss-tolerant (sometimes) loss-tolerant no loss elastic elastic elastic audio: 5Kb-1Mb video:10kb-5mb same as above no no no yes, 100 s msec few Kbps elastic yes, 100 s msec yes and no: μs? yes, few secs 38

Why not always use TCP? TCP provides more than UDP Why not use it for everything?? A: Nothing comes for free... 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? 39

Packet # One lost packet Delayed burst Time to retransmit lost packet Sent packets Received packets (delivered to application) Time 40

Design trade-off 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? OR 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. 41

Blocking sockets 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... 42

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. 43

Web Page Retrieval 1. Static configuration IP address, DNS server IP address, IP address of routers, 2. ARP for router 3. DNS lookup for web server Several packet exchanges for lookup 4. TCP SYN exchange 5. HTTP Get request 6. HTTP response Slow start, retransmissions, etc. 44

Caching Helps 1. Static configuration IP address, DNS server IP address, IP address of routers, 2. ARP for router 3. DNS lookup for web server Several packet exchanges for lookup 4. TCP SYN exchange 5. HTTP Get request 6. HTTP response Slow start, retransmissions, etc. 45

Summary: Internet Architecture Packet-switched datagram network IP is the compatibility layer Hourglass architecture All hosts and routers run IP Stateless architecture no per flow state inside network TCP UDP IP Satellite AT Ethernet M 46

Summary: Minimalist Approach Dumb network IP provide minimal functionalities to support connectivity Addressing, forwarding, routing Smart end system Transport layer or application performs more sophisticated functionalities Flow control, error control, congestion control Advantages Accommodate heterogeneous technologies (Ethernet, modem, satellite, wireless) Support diverse applications (telnet, ftp, Web, X windows) Decentralized network administration 47

Rehashing all of that... 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 48