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

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

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

Lecture 7: Flow Control"

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

Lecture 7: Flow & Media Access Control"

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

Recap. More TCP. Congestion avoidance. TCP timers. TCP lifeline. Application Presentation Session Transport Network Data Link Physical

Overview. Internetworking and Reliable Transmission. CSE 561 Lecture 3, Spring David Wetherall. Internetworking. Reliable Transmission

CSE 461. TCP and network congestion

CSE/EE 461. TCP congestion control. Last Lecture. This Lecture. Focus How should senders pace themselves to avoid stressing the network?

Lecture 6: Reliable Transmission. CSE 123: Computer Networks Alex Snoeren (guest lecture) Alex Sn

ECE697AA Lecture 3. Today s lecture

CSCD 330 Network Programming

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

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

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

Fall 2012: FCM 708 Bridge Foundation I

The Transport Layer Reliability

CSE 123A Computer Networks

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

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

Congestion Control End Hosts. CSE 561 Lecture 7, Spring David Wetherall. How fast should the sender transmit data?

CS457 Transport Protocols. CS 457 Fall 2014

Principles of Reliable Data Transfer

CSCI-1680 Link Layer Reliability John Jannotti

CS419: Computer Networks. Lecture 10, Part 3: Apr 13, 2005 Transport: TCP performance

Transport Protocols CS 640 1

11/24/2009. Fundamentals of Computer Networks ECE 478/578. Flow Control in TCP

Flow and Congestion Control

CSC 4900 Computer Networks: TCP

Reliable Transport : Fundamentals of Computer Networks Bill Nace

Reliable Data Transfer

Transport Layer: Outline

Flow and Congestion Control (Hosts)

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

Communication Networks

Transport Layer: outline

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Lecture 21: Congestion Control" CSE 123: Computer Networks Alex C. Snoeren

image 3.8 KB Figure 1.6: Example Web Page

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

Chapter 3: Transport Layer Part A

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

Flow and Congestion Control Marcos Vieira

Lecture 5. Transport Layer. Transport Layer 1-1

Announcements Computer Networking. What was hard. Midterm. Lecture 16 Transport Protocols. Avg: 62 Med: 67 STD: 13.

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

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Reliable Transport I: Concepts and TCP Protocol

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

Transport Layer (TCP/UDP)

Lecture 14: Congestion Control"

TCP Congestion Control

Reliable Byte-Stream (TCP)

Transport Layer Marcos Vieira

NWEN 243. Networked Applications. Layer 4 TCP and UDP

Congestion Control. Tom Anderson

EE 122: Transport Protocols. Kevin Lai October 16, 2002

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

Direct Link Networks (II)

Data Link Control Protocols

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

End-to-End Protocols. End-to-End Protocols

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

ECE 435 Network Engineering Lecture 10

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

Computer Communication Networks Midterm Review

Lecture - 14 Transport Layer IV (Reliability)

ERROR AND FLOW CONTROL. Lecture: 10 Instructor Mazhar Hussain

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

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 5 - Part 2

Transport Protocols and TCP

Lecture 10: Transpor Layer Principles of Reliable Data Transfer

The Transport Layer Multiplexing, Error Detection, & UDP

Multiple unconnected networks

Computer Networking Introduction

Transport Protocols & TCP TCP

CSCI-1680 Link Layer I Rodrigo Fonseca

Transport Layer Protocols TCP

UNIT IV -- TRANSPORT LAYER

Lecture 3 The Transport Control Protocol (TCP) Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

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

Lecture 11: Transport Layer Reliable Data Transfer and TCP

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

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

Network Management & Monitoring

Chapter 3: Transport Layer

Lecture 12: Transport Layer TCP again

CSE 4213: Computer Networks II

Sequence Number. Acknowledgment Number. Data

Transport Layer (Congestion Control)

Computer Network. Direct Link Networks Reliable Transmission. rev /2/2004 1

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

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

The flow of data must not be allowed to overwhelm the receiver

Intro to LAN/WAN. Transport Layer

End-to-End Protocols: UDP and TCP. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

STEVEN R. BAGLEY PACKETS

COMPUTER NETWORKS CS CS 55201

COMPUTER NETWORKS CS CS 55201

Transcription:

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

Administrativa Home page is up and working http://www-cse.ucsd.edu/classes/sp02/cse123b/ Class notes included Sign up for the class mailing list (instructions on the Web page) First homework will be assigned next Tuesday Class on Thursday is ***cancelled*** April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 2

Last Time We talked about the network layer (IP) and internetworking. We assume: the network provides best-effort (i.e. unreliable) delivery of packets from one host to another How that is done, routing, is left for a future class April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 3

Today s class We begin on the transport layer Builds on the services of the Network layer Communication between processes running on hosts Principle focus How do we ensure that a message is reliably communicated from one host to another? Topics ARQ Sliding windows Retransmission timers April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 4

Thought experiment You want to send a long letter to your friend All you have (and all your friend has) is postcards Postcards get lost in the mail, delayed, damaged How do you send the letter? April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 5

Reliable Transmission How do we reliably send a message when packets can be lost in the network? Some options Detect a loss and retransmit (Cerf&Kahn74, and others) Send redundantly (Byers et al.98, and others) April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 6

Automatic Repeat Request (ARQ) Sender Receiver Sender Receiver Data Data ACK Time Timeout Timeout Data ACK Timeout Packets can be corrupted or lost. How do we add reliability? Acknowledgments (ACKs) and retransmissions after a timeout ARQ is generic name for protocols based on this strategy April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 7

The Need for Sequence Numbers Sender Receiver Sender Receiver Frame ACK Data Data ACK ACK Data ACK Timeout Timeout Timeout Timeout In the case of ACK loss (or poor choice of timeout) the receiver can t distinguish this message from the next Need to understand how many packets can be outstanding and number the packets; here, a single bit will do April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 8

Stop-and and-wait Only one outstanding packet at a time Also called alternating bit protocol Sender Receiver 0 0 1 1 0 0 1 1 April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 9

How does receiver recognize a duplicate? Sequence # in packet is finite Pkt 0 ACK 0 T imeout How many bits do we need? Pkt 0 One bit for stop and wait ACK 0 Pkt Won t send seq #1 until receive ACK for seq #0 1 ACK 1 Only allows one packet in flight April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 10

What if packets are delayed? 0 Never reuse a seq #? Finite 0 Require in order delivery? Prevent very late delivery? TTL: Decrement hop count per packet, discard if exceeded 1 0 1 0 Seq #s not reused within delay bound Trust issues? Accept! Reject! April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 11

What happens if a machine crashes? How do we distinguish packets sent before and after reboot? Which seq# to use? Solutions Restart sequence # at 0? Assume boot takes max packet delay? Choose seq # at random and hope? Use stable storage and increment high order bits of seq # on every boot Reality: People don t worry about this Slow reboots, explicit connection management, tolerant users April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 12

Limitations of Stop-and and-wait Lousy performance if wire time << prop. delay How bad? Want to utilize all available bandwidth Need to keep more data in flight How much? Remember the bandwidth-delay product? Also limited by quality of timeout (how long?) April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 13

Pipelined transmission Send multiple packets without waiting for the first to be ACKed Reliable, unordered delivery: Send new packet after each ACK Sender keeps list of unack ed packets and resends after timeout Receiver same as stop & wait Prob: What if packet 2 keeps being lost? Receiver must buffer all packets after 2 April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 14 Potential buffer overflow

Sliding Window Sender Sender: Window Size Last ACK Last Sent Window bounds outstanding data Implies need for buffering at sender Last ACK applies to in-order data What to do on a timeout? Go-Back-N: one timer, send all unacknowledged data on timeout Selective Repeat: timer per packet, resend as needed April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 15

Sliding Window Receiver Receiver: Receive Window Last Received Largest Accepted Receiver buffers too: data may arrive out-of-order or faster than can be consumed (flow control) Receiver ACK choices: Individual, Cumulative (TCP), Selective (newer TCP), Negative April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 16

Sliding Window Timeline Sender Receiver Time April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 17

Sliding Window Functions Sliding window is a mechanism It supports multiple functions: Reliable delivery In-order delivery Flow control April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 18

Deciding When to Retransmit How do you know when a packet has been lost? Ultimately sender uses timers to decide when to retransmit But how long should the timer be? Too long: inefficient (large delays, poor use of bandwidth) Too short: may retransmit unnecessarily (causing extra traffic) Right timer is based on the round trip time (RTT) Which varies greatly (path length and queuing) April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 19

A Simple Network Model Source 1 Router 1.5-Mbps T1 link Destination 10-Mbps Ethernet 100-Mbps FDDI Source 2 Packets queued here Buffers at routers used to absorb bursts when input rate > output Loss (drops) occur when sending rate is persistently > April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission drain rate

Effects of Early Retransmissions April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 21

Congestion Collapse In the limit, early retransmissions lead to congestion collapse Sending more packets into the network when it is overloaded exacerbates the problem of congestion Network stays busy but very little useful work is being done This happened in real life ~1987 Led to Van Jacobson s TCP algorithms, which form the basis of congestion control in the Internet today [See Congestion Avoidance and Control, SIGCOMM 88] April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 22

Estimating RTTs Idea: Adapt based on recent past measurements Simple algorithm: For each packet, note time sent and time ack received Compute RTT samples and average recent samples for timeout EstimatedRTT = α x EstimatedRTT + (1 - α) x SampleRTT This is an exponentially-weighted moving average that smoothes the samples. Typically, α = 0.8 to 0.9. Set timeout to small multiple (2) of the estimate to capture variation around mean. April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 23

Estimated Retransmit Timer April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 24

Karn/Partridge Algorithm Problem: RTT for retransmitted packets ambiguous Sender Receiver Sender Receiver Original transmission Original transmission ACK ACK Retransmission Retransmission SampleRTT SampleRTT Solution: Don t measure RTT for retransmitted packets and do not relax backed of timeout until valid RTT measurements April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 25

Jacobson/Karels Algorithm Problem: Variance in RTTs gets large as network gets loaded So an average RTT isn t a good predictor when we need it most Solution: Track variance too. Difference = SampleRTT EstimatedRTT EstimatedRTT = EstimatedRTT + (δ x Difference) Deviation = Deviation + δ( Difference - Deviation) Timeout = µ x EstimatedRTT + φ x Deviation In practice, δ = 1/8, µ = 1 and φ = 4 April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 26

Estimate with Mean + Variance April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 27

Can we shortcut the timeout? Problem If a packet is dropped in the network, the sender has to wait until timeout occurs before reacting If packets are usually in order then out-of-rder packets imply that a packet was lost Negative ACK» Receiver requests missing packet Fast retransmit» Receiver ACKs out-of-order packets with seq# of last contiguous packet» When sender receives multiple duplicate acknowledgements resends missing packet April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 28

Fast retransmit Sender Receiver 1 2 3 Time 1 1 April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 29

Alternatives to retransmission? Redundancy Send additional data to compensate for lost packets Why not use retransmission Multicast» Lots of receivers If each one ACK/NAK then hard to scale Lots of messages Lots of state» Heterogeneous receivers Modem vs 100MBps connected hosts One-way or very long delay channels (spacecraft) April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 30

Simplest version Send every packet twice Must lose both packets in a pair to prevent message from being delivered April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 31

Generalization: Forward Error Correction (FEC) Use erasure codes to redundantly encode k source packets into k*m encoded packets Reed Solomon Codes Tornado codes Multicast/broadcast encoded packets continually Any receiver can reconstruct message from any k packets in the set of k*m April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 32

Sometimes referred to as a Digital Fountain File Transmission 0 hours 1 hour 2 hours 3 hours 4 hours User 1 User 2 5 hours April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 33

Pros and Cons of Forward Error Correction Pro Every packet can be useful for all clients Well suited to multicast situation Con Sends more data than ideally necessary Need large block sizes for efficiency April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 34

Summary Transport layer allows processes to communicate with stronger guarantees, e.g., reliability Reliability mechanisms ARQ» Sliding Window + retransmission for efficiency» Retransmission timer must be adaptive FEC» In restricted settings April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 35

For next time Remember that next time is a week from today Read Ch 6.3-6.4 April 9, 2002 CSE 123b -- Lecture 3 Reliable Transmission 36