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

Similar documents
Network Performance: Queuing

Network Performance: Queuing

Announcements. Network Performance: Queuing. Goals of Today s Lecture. Window Scaling. Window Scaling, con t. Window Scaling, con t

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

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

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

Networked Systems and Services, Fall 2017 Reliability with TCP

CS457 Transport Protocols. CS 457 Fall 2014

Flow and Congestion Control

TCP and Congestion Control (Day 1) Yoshifumi Nishida Sony Computer Science Labs, Inc. Today's Lecture

TCP Service Model. Announcements. TCP: Reliable, In-Order Delivery. Today s Lecture. TCP Support for Reliable Delivery. TCP Header

Networked Systems and Services, Fall 2018 Chapter 3

EE 122: IP Forwarding and Transport Protocols

CSE 123A Computer Networks

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

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

Lecture 4: Congestion Control

CS 356: Introduction to Computer Networks. Lecture 16: Transmission Control Protocol (TCP) Chap. 5.2, 6.3. Xiaowei Yang

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

Internet Networking recitation #10 TCP New Reno Vs. Reno

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

COMP/ELEC 429/556 Introduction to Computer Networks

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

Reliable Transport II: TCP and Congestion Control

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

Answers to Sample Questions on Transport Layer

Solutions for Homework #4

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

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

TCP Review. Carey Williamson Department of Computer Science University of Calgary Winter 2018

image 3.8 KB Figure 1.6: Example Web Page

8. TCP Congestion Control

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

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Transmission Control Protocol (TCP)

Congestion / Flow Control in TCP

Transport Protocols & TCP TCP

CS519: Computer Networks. Lecture 5, Part 4: Mar 29, 2004 Transport: TCP congestion control

Computer Networking Introduction

TCP Congestion Control 65KB W

TCP Congestion Control

TCP Congestion Control

CSCD 330 Network Programming

Fast Retransmit. Problem: coarsegrain. timeouts lead to idle periods Fast retransmit: use duplicate ACKs to trigger retransmission

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

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

CS Networks and Distributed Systems. Lecture 10: Congestion Control

Transport Protocols and TCP: Review

Transport Protocols and TCP

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Programming Assignment 3: Transmission Control Protocol

Problem 7. Problem 8. Problem 9

Lecture 3: The Transport Layer: UDP and TCP

TCP: Flow and Error Control

Recap. TCP connection setup/teardown Sliding window, flow control Retransmission timeouts Fairness, max-min fairness AIMD achieves max-min fairness

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

Transport Protocols. Raj Jain. Washington University in St. Louis

Computer Networks. Wenzhong Li. Nanjing University

Computer Communication Networks Midterm Review

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

CS 640 Introduction to Computer Networks Spring 2009

Flow and Congestion Control Marcos Vieira

SSFNET TCP Simulation Analysis by tcpanaly

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

Lecture 15: Transport Layer Congestion Control

Intro to LAN/WAN. Transport Layer

Flow and Congestion Control (Hosts)

Information Network 1 TCP 1/2. Youki Kadobayashi NAIST

cs/ee 143 Communication Networks

ECE 435 Network Engineering Lecture 10

CS268: Beyond TCP Congestion Control

Topics. TCP sliding window protocol TCP PUSH flag TCP slow start Bulk data throughput

Fall 2012: FCM 708 Bridge Foundation I

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

ECE 333: Introduction to Communication Networks Fall 2001

TCP congestion control:

Communication Networks

Introduction to Networking. Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Transport Layer (Congestion Control)

User Datagram Protocol (UDP):

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

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

Chapter 24. Transport-Layer Protocols

User Datagram Protocol

Reliable Transport II: TCP and Congestion Control

TCP Strategies. Keepalive Timer. implementations do not have it as it is occasionally regarded as controversial. between source and destination

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

Congestion Collapse in the 1980s

Homework #4. Due: December 2, 4PM. CWND (#pkts)

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

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

TCP/IP Protocol Suite 1

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

EE122 MIDTERM EXAM: Scott Shenker, Ion Stoica

CS419: Computer Networks. Lecture 10, Part 2: Apr 11, 2005 Transport: TCP mechanics (RFCs: 793, 1122, 1323, 2018, 2581)

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

TCP so far Computer Networking Outline. How Was TCP Able to Evolve

Congestion control in TCP

Transcription:

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 http://inst.eecs.berkeley.edu/~ee122/ Materials with thanks to Jennifer Rexford, Ion Stoica, and colleagues at Princeton and UC Berkeley 1 Announcements Homework #4 should be out tonight Next lecture: network performance 2 1

Goals of Today s Lecture A look at a range of TCP mechanisms that influence its behavior & performance: Window limitations Timeout, slow start, exponential backoff Acking policies Fast Retransmit Fast Recovery (full AIMD) Window scaling Visualized using time-sequence plots 3 Time-Sequence Plots Powerful tool for visualizing transport protocol dynamics Plot sequence number (Y axis) vs. time (X axis) For data packet, sequence number = highest byte carried in packet, so header seqno + payload length For ack, it s just the ack seqno in the header Where do you get the data for the plot? Record trace of connection using tcpdump Illuminates performance achieved & why As well as problems Both network and in endpoint stacks (and also beware measurement errors) 4 2

Example of Time-Sequence Plot Solid squares = Data Hollow squares = Acks Window MSS RTT 5 Example of Time-Sequence Plot Slope gives overall throughput (bytes/sec) 6 3

Same Connection - Why So Different? Note: Receiver acks every other segment 7 Delayed Acknowledgments Receiver generally delays sending an ACK Upon receiving a packet, sets a timer Typically, 200 msec; at most, 500 msec If application generates data, go ahead and send And piggyback the acknowledgment If the timer expires, send a (non-piggybacked) ACK If out-of-order segment arrives, immediately ack (if available window changes, send an ACK) Limiting the wait Receiver supposed to ACK at least every second fullsized packet ( ack every other ) This is the usual case for streaming transfers 8 4

Performance Effects of Acking Policies How do delayed ACKs affect performance? Increases RTT Window slides a bit later throughput a bit lower How does ack-every-other affect performance? If sender adjusts CWND on incoming ACKs, then CWND opens more slowly In slow start, 50% increase/rtt rather than 100% In congestion avoidance, +1 MSS / 2 RTT, not +1 MSS / RTT What does this suggest about how a receiver might cheat and speed up a transfer? 9 ACK-splitting Round- Trip Time (RTT) Sender Data 1:1461 ACK 486 ACK 973 ACK 1461 Data 1461:2921 Data 2921:4381 Data 4381:5841 Data 5841:7301 Receiver Rule: grow window by one full-sized packet for each valid ACK received Send M (distinct) ACKs for one packet Growth factor proportional to M What s the fix? 10 5

10 line change to Linux TCP 60000 Page fetch from CNN.com Sequence Number (bytes) 50000 40000 30000 20000 10000 Modified Client Normal Client (Courtesy of Stefan Savage) 0 0 0.2 0.4 0.6 0.8 1 Time (sec) 11 Sequence Plot for an Entire Transfer Why does this transfer only achieve 50 KB/s? 12 6

Beginning of Transfer - Slow Start Q: Why a gap here? A: That packet is still in flight Q: What is this first small packet? A: The initial SYN Q: Why the long RTT? A: Delayed ack (just for 1 MSS) 13 Mid-Transfer: Self-Clocking Each flight of packets has the same shape! As do the ACKs 14 7

Sliding Window induces Self-Clocking Bottleneck link stretches out data packets Next flight of packets goes out with bottleneck s spacing Spacing is preserved upon arrival and hence in the ACKs (From [JK88]) 15 Mid-Transfer: Why Doesn t CWND Grow? 16 8

Receiver Window = 8 MSS Circles show advertised window 17 Same Transfer w/ Large Recv. Window Throughput doubles But why isn t sender using entire window? 18 9

Sliding Window Allow a larger amount of data in flight Allow sender to get ahead of the receiver though not too far ahead Sending process Receiving process TCP Last byte written TCP Last byte read Sender has Next byte expected Last byte ACKed limited amount of kernel buffer Last byte received Last byte sent 19 Same Transfer w/ Large Recv. Window Sender s window is 9.2 KB (about double receiver s) 20 10

Same Transfer w/ Large Snd. Window Short-term throughput again goes up But what happens here? 21 5 Minute Break Questions Before We Proceed? 22 11

Detecting Loss: Timeout 23 Detecting Loss: Timeout - Recv. View 24 12

Timeout and Effect of SSThresh We finally increment Prior to timeout, CWND in Cong. Avoid CWND = 8 MSS After timeout, CWND = 1 MSS, SSThresh = 4 MSS Slow Start until CWND > 4 MSS, then Cong. Avoidance 25 Illustration of Exponential Backoff 47.9 sec 63.8 sec 23.8 sec RTO progresses 1.8*, 3.0, 6.0, 12.0 sec 26 13

How Many Packets Were Lost? 27 Answer: Zero! 28 14

Fast Retransmission After pending data ack d, slow start. CWND = 2 MSS since ACK arrival incremented it by MSS Window stays at 5 MSS transition to Congestion Avoidance Third dup triggers retransmission 29 Same Fast Retransmission @ Recv. Again, arrivals much more smooth due to bottleneck shaping What happened here? 30 15

Effectiveness of Fast Retransmit When does Fast Retransmit work best? Long data transfers High likelihood of many packets in flight High window size High likelihood of many packets in flight Low burstiness in packet losses Higher likelihood that later packets arrive successfully Implications for Web traffic Most Web transfers are short (e.g., 10 packets) Short HTML files or small images So, often there aren t many packets in flight making fast retransmit less likely to kick in Forcing users to like reload more often 31 Fast Retransmit & Loss of Performance Big juicy pre-loss throughput takes a large hit, even given slow-start to open up CWND again 32 16

Fast Recovery Algorithm As more dups arrive, CWND is inflated, eventually allowing more data to be sent After 3 dups, subsequent dups indicate packets are leaving the network. After pending data ack d, window is set to SSTHRESH (deflated). Connection proceeds at half prev. rate 33 Fast Rexmit/Recovery with > 1 Loss Packet resent due to Fast Retransmit is ack d, but not beyond it. At this point, progress stalls. until timeout (followed by Slow Start). 34 17

Same From Receiver Perspective Many packets are retransmitted unnecessarily (which also causes more dups) Significant holes in original arrivals Fix: Selective Acknowledgment (SACK) option. Sender learns just what receiver has received. Avoids both timeout on second loss, and unnecessary rexmits. 35 Summary of TCP Mechanisms Delayed Acknowledgment Lessens overhead (40 bytes per ACK) But can cause CWND to grow more slowly Fast Retransmit NACK-based loss detection in 1 RTT Avoids timeout delay AIMD after subsequent Slow Start reaches SSTHRESH Fast Recovery Avoids needing to Slow Start after Fast Retransmit True AIMD SACK Both speeds recovery and avoids unnecessary rexmit. 36 18

A Precautionary Tale What s strange about this ACK? 37 Different Problem. What s up now? Is this a measurement drop? What s the evidence? 38 19

Going Fast Q: on a path with RTT = 100 msec, what s the absolute fastest rate that TCP can achieve? Q: what s the absolute largest sliding window that TCP can use? A: advertised window is 16 bits 65,535 bytes Thus: max speed = 65,535 bytes / 100 msec = 655 KB/s Q: how can we fix this problem? A: we need a larger window Q: how do we make the window larger? A: using a TCP option 39 Window Scaling Option (RFC 1323) Source port Destination port HdrLen specifies 4 bytes of options. Kind=3 indicates Window Scaling. Kind=0 indicates end of options. Len=6 0 Checksum Sequence number Acknowledgment Flags Data Advertised window Urgent pointer +---------+---------+---------+---------+ Kind=3 Length=3 shift.cnt Kind=0 +---------+---------+---------+---------+ 40 20

Window Scaling, con t Sent in initial SYN If server s SYN-ACK also includes a Window Scaling option, then scaling is in effect The server including the option confirms its use shift.cnt specifies scaling factor for units used in window advertisement E.g., shift.cnt = 5 advertised window is 2 5 = 32-byte units 41 Window Scaling, con t Q: Now how large can the window be? A: Clearly, must not exceed 2 32 If it does, then can t disambiguate data in flight So, scaling 16 In fact, somewhat subtle requirements limit window to 2 30 to allow receiver to determine whether data fits in the offered window So, scaling 14 42 21

Window Scaling, con t Now we can go fast. Suppose in a high-speed LAN with RTT = 1 msec we can transmit at 1 GB/s. What problem arises if packets are occasionally delayed in the network for 10 msec? Sequence number wrap: can t tell earlier, delayed segments from later instances. Fix: another TCP option to associate (high-res) timestamps with TCP segments Essentially, adds more bits to sequence space (Side effect: no more need for Karn/Partridge restriction not to compute RTT for ACKs of retransmitted packets) 43 Summary Time-Sequence plots provide a powerful tool for visualizing TCP behavior & performance Spectrum of TCP mechanisms influence performance Advertised window, sender window Timeout, slow start, exponential backoff Acking policy (delayed; ack-splitting) Fast Retransmit (avoid RTO stall) Fast Recovery (full AIMD) Window scaling (required for large bandwidth-delay product) Next lecture: a broader view of performance 44 22