Page 1. CS162 Operating Systems and Systems Programming Lecture 22. Networking III. Automatic Repeat Request

Similar documents
Page 1. TCP Flow Control" TCP Flow Control" TCP Flow Control" CS162 Operating Systems and Systems Programming Lecture 16. Flow Control, DNS"

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

EE 122: IP Forwarding and Transport Protocols

Networking Overview. CS Computer Security Profs. Vern Paxson & David Wagner

Announcements. Transport Protocols & DNS. Goals for Today s Lecture, Part 1. Goals of Today s Lecture, Part 2. Transport Protocols

CS457 Transport Protocols. CS 457 Fall 2014

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

Fall 2012: FCM 708 Bridge Foundation I

Computer Communication Networks Midterm Review

Basic Reliable Transport Protocols

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

CS3600 SYSTEMS AND NETWORKS

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

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

CS4700/CS5700 Fundamentals of Computer Networks

CSCD 330 Network Programming

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

The Transport Layer Reliability

CMPE150 Midterm Solutions

Computer Networking Introduction

Problem 7. Problem 8. Problem 9

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

IP ADDRESSES, NAMING, AND DNS

Computer Network Fundamentals Spring Week 10 Congestion Control Andreas Terzis

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

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

CE 443: Computer Networks

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

c) With the selective repeat protocol, it is possible for the sender to receive an ACK for a packet that falls outside of its current window.

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

Good Ideas So Far Computer Networking. Outline. Sequence Numbers (reminder) TCP flow control. Congestion sources and collapse

6.033 Computer System Engineering

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

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

Lecture 7: Flow Control"

Chapter 3: Transport Layer Part A

Communication Networks

CS4700/CS5700 Fundamentals of Computer Networks

CSE 486/586 Distributed Systems

Lecture 5. Transport Layer. Transport Layer 1-1

6.033 Spring 2015 Lecture #11: Transport Layer Congestion Control Hari Balakrishnan Scribed by Qian Long

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

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING

CSE 123A Computer Networks

TCP Congestion Control. Lecture 16. Outline. TCP Congestion Control. Additive Increase / Multiplicative Decrease (AIMD)

ECEN Final Exam Fall Instructor: Srinivas Shakkottai

Potential Name Syntax. Properties of Naming. Naming and system components. Naming and layering. Replicated storage, consistency

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

CS321: Computer Networks Congestion Control in TCP

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

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, Development of reliable protocol Sliding window protocols

ECE 610: Homework 4 Problems are taken from Kurose and Ross.

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

TCP: Flow and Error Control

Principles of Reliable Data Transfer

UDP, TCP, IP multicast

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

Chapter 3 Transport Layer

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

UNIT IV -- TRANSPORT LAYER

ECE 650 Systems Programming & Engineering. Spring 2018

The Transport Layer Multiplexing, Error Detection, & UDP

CSEN 404 Introduction to Networks. Mervat AbuElkheir Mohamed Abdelrazik. ** Slides are attributed to J. F. Kurose

Multiple unconnected networks

Chapter 3 Transport Layer

image 3.8 KB Figure 1.6: Example Web Page

Homework 3 1 DNS. A root. A com. A google.com

COMPUTER NETWORK. Homework #3. Due Date: May 22, 2017 in class

ECE 333: Introduction to Communication Networks Fall 2001

Flow & Congestion Control

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

EE 122: Domain Name System

Reminders. EE 122: Domain Name System. Goals of Today!s Lecture. Host Names vs. IP addresses. Separating Naming and Addressing

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

Transport protocols. Transport Layer 3-1

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

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli)

Communication Networks

CSE 473 Introduction to Computer Networks. Exam 2. Your name here: 11/7/2012

Introduction to Networks and the Internet

8. TCP Congestion Control

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

Principles of congestion control

ECSE-6600: Internet Protocols Spring 2007, Exam 1 SOLUTIONS

COMP/ELEC 429/556 Introduction to Computer Networks

CS155b: E-Commerce. Lecture 3: Jan 16, How Does the Internet Work? Acknowledgements: S. Bradner and R. Wang

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

CSEN 503 Introduction to Communication Networks

ECS 152A Computer Networks Instructor: Liu. Name: Student ID #: Final Exam: March 17, 2005

TCP congestion control:

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

Lecture 3: The Transport Layer: UDP and TCP

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

PLEASE READ CAREFULLY BEFORE YOU START

PLEASE READ CAREFULLY BEFORE YOU START

L12: end to end layer

Chapter III: Transport Layer

CSC 401 Data and Computer Communications Networks

Transcription:

Review CS162 Operating Systems and Systems Programming Lecture 22 Networking III April 22, 2010 Ion Stoica http://inst.eecs.berkeley.edu/~cs162 Link (link) layer: Broadcast network; frames sent by one host reaches every other host in same network Multi-access protocol (didn t go over) construct frames, error detection and correction, flow control, Network layer: stitch together multiple link layer networks Deliver a packet to specified network destination (didn t go over) segmentation/reassemble, packet scheduling, buffer management Transport layer Multiplexing/demultiplexing (two lectures ago) Flow & congestion control, in-order delivery, reliability (today) Lec 22.2 Transport Protocol Automatic Repeat request (ARQ) Flow control keeps one fast sender from overwhelming a slow receiver Congestion control keeps a set of senders from overloading the network Reliability makes sure the receiver got all packets sent by sender In-order delivery makes sure the receiver delivers the packet to application in same order sender sent them Two protocols: Stop-and-Wait Window based Automatic Repeat Request sends acknowledgment (ACK) when it receives packet waits for ACK and times out if does not arrive within some time period Simplest ARQ protocol Stop and Wait Send a packet, stop and wait until ACK arrives Time Timeout Packet ACK Lec 22. Lec 22.4 Page 1

Stop-and-Wait Properties Flow control: yes can implicitly slow down sender by acking a packet only if it has room for at lest another packet Assumption: timeout doesn t trigger before receiving ack Congestion control: yes sends a new packet only after previous one made it If network is congested packet or ack is lost sender doesn t send new Reliability: yes If a packet is lost, sender timeouts and resends the packet In-order delivery: yes doesn t get next packet before receiving (and acking) previous one So what s the problem with Stop-and-Wait? Efficiency! How Fast Can Stop-and-Wait Go? Suppose we re sending from UCB to New York: Bandwidth = 1 Mbps (megabits/sec) RTT = 100 msec Maximum packet size a.k.a. Maximum Transmission Unit (MTU) = 1500 B = 12,000 b No other load on the path and no packet loss What (approximately) is the fastest we can transmit using Stop-and-Wait? Answer: 12,000b/0.1s = 120 kbps How about if Bandwidth = 1 Gbps? Lec 22.5 Lec 22.6 Administrivia Sliding Window Keys to access AWS will be sent today Last two lectures on security Final Exam Friday, May 14, 7:00PM-10:00PM All material from the course» With slightly more focus on second half, but you are still responsible for all the material Two sheets of notes, both sides Idea: allow multiple packets in-flight In-flight = un-acked packets Window size (W): number of packets the sender can send without receiving an ack E.g., after receiving ack for all packet before and including K, send packets K+1, K+2,, K+W+1 Stop-and-wait: particular case of sliding window, W=1 tells sender W W cannot be larger than receiver s buffer! Lec 22.7 Lec 22.8 Page 2

Throughput Up to W packets (or bytes) per RTT Throughput = W/RTT How large should be the window to fully utilize a link with bandwidth B? W = Bandwidth x RTT (i.e., Bandwidth-Delay or Delay-Bandwidth product) (This is NOT TCP!) Sending rate = 1 pkt/s Packet size = 1000b : Delivering rate = 0.5 pkt/s Delivers packets in to application Acknowledges (acks) each delivered pkt Send negative ack. (nack) if packet lost Round-trip time = 4 sec, ec each way Window = 4 packets Note: max. achievable throughput = 0.5pkt/s = 500b/s Lec 22.9 Lec 22.10, at 1s Send 1 st pkt 1 1 1s Lec 22.11, at 1s Send 1 st pkt, at Get 1 st pkt Deliver 1 st pkt to appl. Send to sender 1 1 1s 1 Lec 22.12 Page

, at Send 2 nd pkt, which is lost 1 1 2 1 2 Lec 22.1 1s, at Send nd pkt, at : Get rd pkt; doesn t deliver it since out of seq. Send nack=2 (request 2 nd pkt) 1 1 2 1 2 2 1 nack=2 Lec 22.14 1s, at Send 4 th pkt window full!, at Get 4 th packet 1 1 2 1 2 2 1 4 2 1 4 nack=2 4 Lec 22.15 1s, at Get Remove 1 st pkt from buffer Send 5 th pkt; now 2,, 4, 5 are in flight (window full!), at Get 5 th pkt 1 1 2 1 2 2 1 4 2 1 4 5 4 2 5 nack=2 4 5 4 Lec 22.16 1s Page 4

, at Get nack=2 Resend pkt 2, at Get 2 nd pkt Deliver it to appl. Send ack=2 1 1 2 1 2 2 1 4 2 1 4 5 4 2 5 5 4 2 2 nack=2 ack=2 4 5 4 5 4 2 Lec 22.17 1s, at Get ack=2 Send pkt 6; pkts, 4, 5, 6 are in-flight, at Deliver d pkt to appl. (recall, delivery rate is 1pkt every ) Send ack= 1 1 2 1 2 2 1 4 2 1 4 5 4 2 5 5 4 2 2 nack=2 ack=2 4 5 4 5 4 2 6 5 4 6 5 4 ack= Lec 22.18 1s Performance with Sliding Window If no more losses, throughput = 0.5pkt/sec This is max throughput as receiver cannot deliver more than 0.5pkt/sec 6 5 4 6 5 4 7 6 5 4 7 ack= ack=4 6 5 4 8 7 6 5 8 7 6 5 ack=5 9 8 7 6 9 8 7 6 ack=6 9 8 7 1 1 1 1 1 20s Given previous UCB New York 1 Mbps path with 100 msec RTT, and (and ) window = 100 Kb = 12.5 KB How fast can we transmit? Answer: min(100kb/0.1s, 1Mbps) = 1 Mbps What about with 12.5 KB window & 1 Gbps path? Window required to fully utilize path: W = Bandwidth x RTT = 1 Gbps * 100 msec = 100 Mb = 12.5 MB Note: large window = many packets in flight Lec 22.19 Lec 22.20 Page 5

Sliding Window Properties Flow control: yes tells the sender how many packets it can send without hearing an ack (windaw size) Congestion control: not really. Why? Reliability: yes resends lost packet on receiving nack or on timeout In-order delivery: yes Use sequence numbers for packets; delivers in-sequence packets to app; if a packet is missing, stop and wait for the packet to be retransmitted; Congestion Two packets arrive at the same time The node can only transmit one and either buffers or drops the other If many packets arrive in a short period of time The node cannot keep up with the arriving traffic and the buffer may eventually overflow Lec 22.21 Lec 22.22 Congestion Collapse Two Basic Components (TCP) Definition: Increase in network load results in a decrease of useful work done Due to: Undelivered packets» Packets consume resources and are dropped later in network Spurious retransmissions of packets still in flight» Unnecessary retransmissions lead to more load!» Pouring gasoline on a fire Mid-1980s: Internet grinds to a halt Until Jacobson/Karels (Berkeley!) devise TCP congestion control Detect congestion = detect packet loss ACK denotes next byte (n) expected to be received» acks it has received all bytes up to n-1 Two signs of packet loss» No ACK after certain time interval: time-out» Several duplicate ACKs (receiver misses packet starting with byte n+1, and has received several packets after that) Dealing with congestion: Probe network to test level of congestion Speed up when no congestion Slow down when congestion Suboptimal, messy dynamics, simple to implement Lec 22.2 Lec 22.24 Page 6

TCP Congestion Control TCP connection has window Controls number of unacknowledged packets Sending rate: ~Window/RTT Vary window size to control sending rate Sizing the Windows cwnd (Congestion Windows) How many bytes can be sent without overflowing routers Computed by congestion control algorithm AdvertisedWindow How many bytes can be sent without overflowing the sender (flow control) Determined by the receiver uses min between the two MaxWindow = min(cwnd, AdvertisedWindow) 25 Lec 22.25 26 Lec 22.26 Rate Adjustment Basic structure: Upon receipt of ACK (of new ): increase rate Upon detection of loss: decrease rate But what increase/decrease functions should we use? Increase window by 1 packet every RTT Decrease window by half if packet loss [Far more in the networking class] Addresses and Names 27 Lec 22.27 Page 7

IP Addresses (IPv4) A unique 2-bit number Identifies an interface (on a host, on a router, ) Represented in dotted-quad notation. E.g, 12.4.158.5: 12 4 158 5 00001100 00100010 10011110 00000101 Hierarchical Addressing: IP Prefixes Divided into network (left) & host portions (right) 12.4.158.0/24 is a 24-bit prefix with 2 9 addresses Terminology: Slash 24 12 4 158 5 00001100 00100010 10011110 00000101 Network (24 bits) Host (8 bits) Lec 22.29 Lec 22.0 IP Address and a 24-bit Subnet Mask Address 12 4 158 5 00001100 00100010 10011110 00000101 11111111 11111111 11111111 00000000 255 255 255 0 Mask Hierarchical Addressing Example Number related hosts from a common subnet 1.2..0/24 on the left LAN (Local Area Network) 5.6.7.0/24 on the right LAN 1.2..4 1.2..7 1.2..156 5.6.7.8 5.6.7.9 5.6.7.212 host host... host host host... host LAN 1 1.2..0/24 5.6.7.0/24 router router router forwarding table LAN 2 Lec 22.1 Lec 22.2 Page 8

IP addresses vs. Host Name IP addresses Numerical address appreciated by routers Fixed length, binary number Hierarchical, related to host location Examples: 64.26.16.20 and 212.58.224.11 Host names Mnemonic name appreciated by humans Variable length, full alphabet of characters Provide little (if any) information about location Examples: www.cnn.com and bbc.co.uk Separating Naming and Addressing Names are easier to remember www.cnn.com vs. 64.26.16.20 Addresses can change underneath Move www.cnn.com to 64.125.91.21 E.g., renumbering when changing providers Name could map to multiple IP addresses www.cnn.com to multiple (8) replicas of the Web site Enables» Load-balancing» Reducing latency by picking nearby servers» Tailoring content based on requester s location/identity Multiple names for the same address E.g., aliases like www.cnn.com and cnn.com Lec 22. Lec 22.4 Scalable (Name Address) Mappings Domain Name System (DNS) Originally: per-host file Flat namespace /etc/hosts (what is this on your computer today?) SRI (Menlo Park) kept master copy Downloaded regularly Single server doesn t scale Traffic implosion (lookups & updates) Single point of failure Need a distributed, hierarchical collection of servers Properties of DNS Hierarchical name space divided into zones Zones distributed over collection of DNS servers Hierarchy of DNS servers Root (hardwired into other servers) Top-level domain (TLD) servers Authoritative DNS servers Performing the translations Local DNS servers Resolver software Lec 22.5 Lec 22.6 Page 9

Distributed Hierarchical Database unnamed root com edu org ac uk zw arpa west foo bar generic domains east my country domains Top-Level Domains (TLDs) ac cam usr inaddr Using DNS Local DNS server ( default name server ) Usually near the endhosts that use it Local hosts configured with local server (e.g., /etc/ resolv.conf) or learn server automatically (via DHCP) Client application Extract server name (e.g., from the URL) Do gethostbyname() to trigger resolver code Server application Extract client IP address from connection Optional gethostbyaddr() to translate into name my.east.bar.edu usr.cam.ac.uk Lec 22.7 Lec 22.8 Example Recursive vs. Iterative Queries Host at cs.berkeley.edu wants IP address for gaia.cs.umass.edu local DNS server dns.berkeley.edu 2 root DNS server TLD DNS server 4 5 Recursive query Ask server to get answer for you E.g., request 1 and response 8 local DNS server cs.berkeley.edu 2 root DNS server TLD DNS server 4 5 1 8 7 6 1 8 7 6 requesting host cs.berkeley.edu authoritative DNS server dns.cs.umass.edu gaia.cs.umass.edu requesting host cs.berkeley.edu authoritative DNS server dns.cs.umass.edu Lec 22.9 Lec 22.40 Page 10

Iterative query Ask server who to ask next E.g., all other request-response pairs Recursive vs. Iterative Queries local DNS server dns.berkeley.edu 1 2 requesting host cs.berkeley.edu root DNS server 4 7 5 TLD DNS server 6 8 authoritative DNS server dns.cs.umass.edu Conclusion Transport layer: Main service (TCP & UDP): port multiplexing/ demultiplexing Other services (TCP):» reliability» congestion control: avoid overloading the network» Flow control: allow overflowing the receiver» in-order delivery IP Addressing 2b (IP v4), quad notation Capture host location Network and host portions DNS: System for mapping from names IP addresses Hierarchical mapping from authoritative domains Recursive vs. iterative lookup Lec 22.41 Lec 22.42 Putting Everything Together Putting Everything Together Proc. A (port 10) Internet Proc. B (port 7) Proc. A (port 2) Internet Proc. B (port 7) 16.25.1.10 128.15.11.12 1.2..7 5.6.4. Proc. A (port 10) Proc. B (port 7) Proc. A Transport Network Link 10 10 7 7 16.25.1.10 128.15.11.12 10 10 7 7 16.25.1.10 128.15.11.12 Transport Network Link Physical Physical 16.25.1.10 Internet 128.15.11.12 Lec 22.4 Transport (port=2) Network (addr=1.2..7) Link (addr=15) Physical 2 7 2 7 1.2..7 5.6.4. 2 7 1.2..7 5.6.4. 15 91 2 7 1.2..7 5.6.4. 2 7 1.2..7 5.6.4. 15 91 Network Link (addr=91) Physical Lec 22.44 Page 11

1.2..4 1.2..7 1.2..156 5.6.7.8 5.6.7.9 5.6.7.212 host host... host host host... host LAN 1 router router router LAN 2 Lec 22.45 Page 12