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

Similar documents
8. TCP Congestion Control

TCP congestion control:

Overview. TCP congestion control Computer Networking. TCP modern loss recovery. TCP modeling. TCP Congestion Control AIMD

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

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

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Overview. TCP & router queuing Computer Networking. TCP details. Workloads. TCP Performance. TCP Performance. Lecture 10 TCP & Routers

image 3.8 KB Figure 1.6: Example Web Page

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

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

TCP Basics : Computer Networking. Overview. What s Different From Link Layers? Introduction to TCP. TCP reliability Assigned reading

TCP Congestion Control

TCP Congestion Control

ECE 435 Network Engineering Lecture 10

Chapter 24. Transport-Layer Protocols

Congestion Control 3/16/09

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

CS321: Computer Networks Congestion Control in TCP

Networked Systems and Services, Fall 2017 Reliability with TCP

TCP Enhancements in Linux. Pasi Sarolahti. Berkeley Summer School Outline

TCP Congestion Control

Q23-5 In a network, the size of the receive window is 1 packet. Which of the follow-ing protocols is being used by the network?

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

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

cs/ee 143 Communication Networks

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

Outline. CS5984 Mobile Computing

Congestion Control. Daniel Zappala. CS 460 Computer Networking Brigham Young University

Network Protocols. Transmission Control Protocol (TCP) TDC375 Autumn 2009/10 John Kristoff DePaul University 1

COMP/ELEC 429/556 Introduction to Computer Networks

ADVANCED COMPUTER NETWORKS

Networked Systems and Services, Fall 2018 Chapter 3

Bandwidth Allocation & TCP

Internet Networking recitation #10 TCP New Reno Vs. Reno

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

Outline Computer Networking. Functionality Split. Transport Protocols

ENRICHMENT OF SACK TCP PERFORMANCE BY DELAYING FAST RECOVERY Mr. R. D. Mehta 1, Dr. C. H. Vithalani 2, Dr. N. N. Jani 3

Computer Networks and Data Systems

Computer Networking Introduction

Fall 2012: FCM 708 Bridge Foundation I

Transport Layer PREPARED BY AHMED ABDEL-RAOUF

Transport Protocols and TCP: Review

Transport Layer (Congestion Control)

Detecting half-open connections. Observed TCP problems

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

Transport Layer. -UDP (User Datagram Protocol) -TCP (Transport Control Protocol)

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

CSE 461. TCP and network congestion

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

Impact of transmission errors on TCP performance. Outline. Random Errors

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

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

Congestion / Flow Control in TCP

Operating Systems and Networks. Network Lecture 10: Congestion Control. Adrian Perrig Network Security Group ETH Zürich

Where we are in the Course. Topic. Nature of Congestion. Nature of Congestion (3) Nature of Congestion (2) Operating Systems and Networks

Congestion Collapse in the 1980s

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2014

Transport Protocols & TCP TCP

Congestion control in TCP

Transport Protocols and TCP

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2014

Advanced Computer Networks

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

05 Transmission Control Protocol (TCP)

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

CS Networks and Distributed Systems. Lecture 10: Congestion Control

F-RTO: An Enhanced Recovery Algorithm for TCP Retransmission Timeouts

CS3600 SYSTEMS AND NETWORKS

Programming Assignment 3: Transmission Control Protocol

Flow and Congestion Control (Hosts)

Outline. User Datagram Protocol (UDP) Transmission Control Protocol (TCP) Transport layer (cont.) Transport layer. Background UDP.

CS 640 Introduction to Computer Networks Spring 2009

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

CE693 Advanced Computer Networks

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

Communication Networks

Improved Selective Acknowledgment Scheme for TCP

User Datagram Protocol (UDP):

CMPE 257: Wireless and Mobile Networking

Flow and Congestion Control Marcos Vieira

Chapter III. congestion situation in Highspeed Networks

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

Congestion Control In The Internet Part 2: How it is implemented in TCP. JY Le Boudec 2015

Congestion Control. Queuing Discipline Reacting to Congestion Avoiding Congestion. Issues

CS4700/CS5700 Fundamentals of Computer Networks

Reliable Transport I: Concepts and TCP Protocol

Congestion Control in TCP

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

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

TCP Congestion Control 65KB W

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

Performance Analysis of TCP Variants

Lecture 15: Transport Layer Congestion Control

Intro to LAN/WAN. Transport Layer

Reliable Transport I: Concepts and TCP Protocol

CSE 473 Introduction to Computer Networks. Midterm Exam Review

Congestion. Can t sustain input rate > output rate Issues: - Avoid congestion - Control congestion - Prioritize who gets limited resources

Computer Communication Networks Midterm Review

ECE 461 Internetworking. Problem Sheet 6

Chapter III: Transport Layer

Transcription:

Fast Retransmit Problem: coarsegrain TCP timeouts lead to idle periods Fast retransmit: use duplicate ACKs to trigger retransmission Packet 1 Packet 2 Packet 3 Packet 4 Packet 5 Packet 6 Sender Receiver ACK 1 ACK 2 ACK 2 ACK 2 ACK 2 Retransmit packet 3 ACK 6 page 1

Fast Retransmit If we get 3 duplicate acks for segment N Retransmit segment N Set ssthresh to 0.5*cwnd Set cwnd to ssthresh + 3 For every subsequent duplicate ack Increase cwnd by 1 segment When new ack received Reset cwnd to ssthresh (resume congestion avoidance) page 2

Congestion Avoidance TCP needs to create congestion to find the point where congestion occurs Coarse grained timeout as loss indicator If loss occurs when cwnd = W Network can absorb 0.5W ~ W segments Set cwnd to 0.5W (multiplicative decrease) Needed to avoid exponential queue buildup Upon receiving ACK Increase cwnd by 1/cwnd (additive increase) Multiplicative increase -> non-convergence page 3

Slow Start and Congestion Avoidance If packet is lost we lose our self clocking as well Need to implement slow-start and congestion avoidance together When timeout occurs set ssthresh to 0.5w If cwnd < ssthresh, use slow start Else use congestion avoidance page 4

Fast Recovery In congestion avoidance mode, if duplicate acks are received, reduce cwnd to half If n successive duplicate acks are received, we know that receiver got n segments after lost segment: Advance cwnd by that number page 5

Results KB 70 60 50 40 30 20 10 1.0 2.0 3.0 4.0 5.0 6.0 7.0 Fast recovery skip the slow start phase go directly to half the last successful CongestionWindow (ssthresh) page 6

Impact of Timeouts Timeouts can cause sender to Slow start Retransmit a possibly large portion of the window Bad for lossy high bandwidth-delay paths Can leverage duplicate acks to: Retransmit fewer segments (fast retransmit) Advance cwnd more aggressively (fast recovery) page 7

Summary Three way handshake to initiate TCP. Either side can tear down connection using FIN sequence. Initial sequence number chosen to avoid packets from earlier incarnations AIMD to slowly probe network. Slow start to speed up the probing process (at the expense of hard congestion for the last step). Use ssthresh to decide whether to restart slow start or AIMD after loss Fast retransmit by inferring duplicate ACKs = lost packet, Fast recovery by inferring duplicate ACKs = increasing CWND page 8

TCP Extensions Implemented using TCP options Timestamp Protection from sequence number wraparound Large windows page 9

Timestamp Extension Used to improve timeout mechanism by more accurate measurement of RTT When sending a packet, insert current timestamp into option Receiver echoes timestamp in ACK page 10

Protection Against Wrap Around 32-bit SequenceNum Bandwidth T1 (1.5 Mbps) Ethernet (10 Mbps) T3 (45 Mbps) FDDI (100 Mbps) STS-3 (155 Mbps) STS-12 (622 Mbps) STS-24 (1.2 Gbps) Time Until Wrap Around 6.4 hours 57 minutes 13 minutes 6 minutes 4 minutes 55 seconds 28 seconds Use timestamp to distinguish sequence number wraparound page 11

Keeping the Pipe Full 16-bit AdvertisedWindow Bandwidth T1 (1.5 Mbps) Ethernet (10 Mbps) T3 (45 Mbps) FDDI (100 Mbps) STS-3 (155 Mbps) STS-12 (622 Mbps) STS-24 (1.2 Gbps) Delay x Bandwidth Product 18KB 122KB 549KB 1.2MB 1.8MB 7.4MB 14.8MB page 12

Large Windows Apply scaling factor to advertised window Specifies how many bits window must be shifted to the left Scaling factor exchanged during connection setup page 13

TCP Flavors Tahoe, Reno, Vegas TCP Tahoe (distributed with 4.3BSD Unix) Original implementation of van Jacobson s mechanisms (VJ paper) Includes: Slow start (exponential increase of initial window) Congestion avoidance (additive increase of window) Fast retransmit (3 duplicate acks) page 14

TCP Reno 1990: includes: All mechanisms in Tahoe Addition of fast-recovery (opening up window after fast retransmit) Delayed acks (to avoid silly window syndrome) Silly window syndrome is when one byte is ack d causing advertisedwindow=1 Header prediction (to improve performance) page 15

SACK TCP (RFC 2018)

What s Wrong with Current TCP? TCP uses a cumulative acknowledgment scheme, in which the receiver identifies the last byte of data successfully received. Received segments that are not at the left window edge are not acknowledged. This scheme forces the sender to either wait a roundtrip time to find out a segment was lost, or unnecessarily retransmit segments which have been correctly received. Results in significantly reduced overall throughput. page 17

Selective Acknowledgment TCP Selective Acknowledgment (SACK) allows the receiver to inform the sender about all segments that have been successfully received. Allows the sender to retransmit only those segments that have been lost. SACK is implemented using two different TCP options. page 18

The SACK-Permitted Option The first TCP option is the enabling option, SACKpermitted, allowed only in a SYN segment. This indicates that the sender can handle SACK data and the receiver should send it, if possible. (Both sides can enable SACK, but each direction of the TCP connection is treated independently.) TCP header length standard HL = 6 1 TCP header SYN bit Kind = 4 Length = 2 Kind = 1 Kind = 1 options field SACK-permitted NOP NOP page 19

The SACK Option If the SACK-permitted option is received, the receiver may send the SACK option. What is a simple formula for the SACK option length field (based on n, the number of blocks in the option)? (2 + 8 * n) bytes HL = Y Kind = 1 Kind = 1 Kind = 5 Left Edge of 1 st Block Right Edge of 1 st Block Left Edge of n th Block Right Edge of n th Block Length = X standard What is the maximum TCP header number of SACK blocks possible? Why? The maximum size of the options field options is 40 field bytes, giving a maximum of 4 SACK blocks (barring no other TCP options). page 20

The SACK Option Each block in a SACK represents bytes successfully received that are contiguous and isolated (the bytes immediately to the left and the right have not yet been received). 5000-5499 ACK 5500 receiver sender 6000-6499 6500-6999 5500-5999 ACK 5500; SACK=6000-6500 ACK 5500; SACK=6000-7000 page 21

SACK TCP Rules A SACK cannot be sent unless the SACKpermitted option has been received (in the SYN). If a receiver has chosen to send SACKs, it must send them whenever it has data to SACK at the time of an ACK. The receiver should send an ACK for every valid segment it receives containing new data (standard TCP behavior), and each of these ACKs should contain a SACK, assuming there is data to SACK. page 22

SACK TCP Rules The first SACK block must contain the most recently received segment that is to be SACKed. The second block must contain the second most recently received segment that is to be SACKed, and so forth. Notice this can result in some data in the receiver s buffers which should be SACKed but is not (if there are more segments to SACK than available space in the TCP header). page 23

SACK TCP Example (assuming a maximum of 3 blocks) 5500-5999 5000-5499 ACK 5500 6500-6999 6000-6499 ACK 5500; SACK=6000-6500 receiver sender 7500-7999 7000-7499 ACK 5500; SACK=7000-7500, 6000-6500 8500-8999 8000-8499 ACK 5500; SACK=8000-8500, 7000-7500, 6000-6500 9000-9499 ACK 5500; SACK=9000-9500, 8000-8500, 7000-7500 page 24

SACK TCP Example (continued) At this point, the 4th segment (6500-6999) is received. After the receiver acknowledges this reception, the 2nd segment (5500-5999) is received. ACK 5500; SACK=9000-9500, 8000-8500, 7000-7500 sender 6500-6999 ACK 5500; SACK=6000-7500,9000-9500,8000-8500 receiver 5500-5999 ACK 7500; SACK=9000-9500,8000-8500 page 25

What Should the Sender do? The sender must keep a buffer of unacknowledged data. When it receives a SACK option, it should turn on a SACK-flag bit for all segments in the transmit buffer that are wholly contained within one of the SACK blocks. After this SACK flag bit has been turned on, the sender should skip that segment during any later retransmission. page 26

SACK TCP at the Sender Example 5500-5999 5000-5499 6000-6499 6500-6999 7000-7499 SENDER TIMEOUT sender ACK 5500; SACK=6000-6500 ACK 5500; SACK=6000-7000 5500-5999 7000-7499 ACK 5500; SACK=6000-7500 receiver page 27

Receiver Has A Two-Segment Buffer (A Problem?) 5000-5499 5500-5999 Receiver s Buffer What is the ACK / SACK segment sent from the 5000-5499 receiver at this point? 6000-6499 ACK 6000; SACK=6500-7000 sender ACK 5500; SACK=6000-6500 6500-6999 receiver 6000-6499 ACK 5500; SACK=6000-7000 6000-6499 6500-6999 5500-5999 5500-5999 6500-6999 page 28

Reneging in SACK TCP It is possible for the receiver to SACK some data and then later discard it. This is referred to as reneging. This is discouraged, but permitted if the receiver runs out of buffer space. If this occurs, The first SACK block must still reflect the newest segment, i.e. contain the left and right edges of the newest segment, even if that segment is going to be discarded. Except for the newest segment, all SACK blocks must not report any old data that has been discarded. page 29

Reneging in SACK TCP Therefore, the sender must maintain normal TCP timeouts. A segment cannot be considered received until an ACK is received for it. The sender must retransmit the segment at the left window edge after a retransmit timeout, even if the SACK bit is on for that segment. A segment cannot be removed from the transmit buffer until the left window edge is advanced over it, via the receiving of an ACK. page 30

SACK TCP Observations SACK TCP follows standard TCP congestion control; it should not damage the network. SACK TCP has an advantage over other implementations (Reno, Tahoe, Vegas, and NewReno) as it has added information due to the SACK data. This information allows the sender to better decide what it needs to retransmit and what it does not. This can only serve to help the sender, and should not adversely affect other TCPs. page 31

SACK TCP Observations While it is still possible for a SACK TCP to needlessly retransmit segments, the number of these retransmissions has been shown to be quite low in simulations, relative to Reno and Tahoe TCP. In any case, the number of needless retransmissions must be strictly less than Reno/Tahoe TCP. As the sender has additional information from which to devise its retransmission scheme, worse performance is not possible (barring a flawed implementation). page 32

SACK TCP Implementation Progress Current SACK TCP implementations: Windows 2000 Windows 98 / Windows ME Solaris 7 and later Linux kernel 2.1.90 and later FreeBSD and NetBSD have optional modules ACIRI has measured the behavior of 2278 random web servers that claim to be SACK-enabled. Out of these, 2133 (93.6%) appeared to ignore SACK data and only 145 (6.4%) appeared to actually use the SACK data. page 33

D-SACK TCP (RFC 2883)

One Step Further: D-SACK TCP Duplicate-SACK, or D-SACK is an extension to SACK TCP which uses the first block of a SACK option is used to report duplicate segments that have been received. A D-SACK block is only used to report a duplicate contiguous sequence of data received by the receiver in the most recent segment. Each duplicate is reported at most once. This allows the sender TCP to determine when a retransmission was not necessary. It may not have been necessary due to the retransmit timer expiring prematurely or due to a false Fast Retransmit (3 duplicate ACKs received due to network reordering). page 35

D-SACK Example (packet replicated by the network) 3500-3999 ACK 4000 4000-4499 receiver sender 4500-4999 ACK 4000; SACK=4500-5000 5000-5499 ACK 4000; SACK=4500-5500 ACK 4000; SACK=5000-5500, 4500-5500 page 36

D-SACK Example (losses, and the sender changes the segment size) 1000-1499 500-999 1500-1999 2000-2499 ACK 1000 2500-2999 receiver sender 1000-2499 ACK 1000; SACK=3000-3500 3000-3499 ACK 1500; SACK=3000-3500 ACK 1500; SACK=2000-2500,3000-3500 ACK 2500; SACK=1000-1500, 3000-3500 page 37

D-SACK TCP Rules If the D-SACK block reports a duplicate sequence from a (possibly larger) block of data in the receiver buffer above the cumulative acknowledgement, the second SACK block (the first non D-SACK block) should specify this block. As only the first SACK block is considered to be a D-SACK block, if multiple sequences are duplicated, only the first is contained in the D- SACK block. page 38

D-SACK TCP and Retransmissions D-SACK allows TCP to determine when a retransmission was not necessary (it receives a D-SACK after it retransmitted a segment). When this determination is made, the sender can undo the halving of the congestion window, as it will do when a segment is retransmitted (as it assumes net congestion). D-SACK also allows TCP to determine if the network is duplicating packets (it will receive a D-SACK for a segment it only sent once). D-SACK s weakness is that is does not allow a sender to determine if both the original and retransmitted segment are received, or the original is lost and the retransmitted segment is duplicated by the network. page 39

SACK and D-SACK Interaction There is no difference between SACK and D- SACK, except that the first SACK block is used to report a duplicate segment in D-SACK. There is no separate negotiation/options for D- SACK. There are no inherit problems with having the receiver use D-SACK and having the sender use traditional SACK. As the duplicate that is being reported is still being SACKed (for the second or greater time), there is no problem with a SACK TCP using this extension with a D-SACK TCP (although the D-SACK specific data is not used). page 40

Increasing the Maximum TCP Initial Window Size (RFC 2414)

Increasing the Initial Window RFC 2414 specifies an experimental change to TCP, the increasing of the maximum initial window size, from one segment to a larger value. This new larger value is given as: min ( 4*MSS, max ( 2*MSS, 4380 bytes) ) This translates to: Maximum Segment Size (MSS) <= 1095 bytes 1095 bytes < MSS < 2190 bytes >= 2190 bytes Maximum Initial Window Size <= 4 * MSS <= 4380 bytes <= 2 * MSS page 42

Increasing the Initial Window Slow-Start TCP RFC 2414 TCP PROCESSING DELAY receiver sender PROCESSING DELAY receiver sender page 43

Advantages of an Increased Initial Window Size This change is in contrast to the slow start mechanism, which initializes the initial window size to one segment. This mechanism is in place to implement sender-based congestion control (see RFC 2001 for a complete discussion). This new larger window offers three distinct advantages: With slow start, a receiver which uses delayed ACKs is forced to wait for a timeout before generating an ACK. With an initial window of at least two segments, the receiver will generate an ACK after the second segment arrives, causing a speedup in data acknowledgement. page 44

Advantages of an Increased Initial Window Size For TCP connections transferring a small amount of data (such as SMTP and HTTP requests), the larger initial window will reduce the transmission time, as more data can be outstanding at once. For TCP connections transferring a large amount of data with high propagation delays (long haul pipes; such as backbone connects and satellite links), this change eliminates up to three round-trip times (RTTs) and a delayed ACK timeout during the initial slow start. page 45

Disadvantages of an Increased Initial Window Size This approach also has disadvantages: This approach could cause increased congestion, as multiple segments are transmitted at once, at the beginning of the connection. As modern routers tend to not handle bursty traffic well (Drop Tail queue management), this could increase the drop rate. ACIRI research on this topic concludes that there is no more danger from increasing the initial TCP window size to a maximum of 4KB than the presence of UDP communications (that do not have end-to-end congestion control). page 46

Increased Initial Window Size Implementation Progress Looking at ACIRI observations, current web servers use a wide range of initial TCP window sizes, ranging from one segment (slow start) to seventeen segments. This is a clear violation of RFC 2414, not to mention RFC 2001 (the currently approved IETF/ISOC standard). Such large initial window sizes seem to indicate a greedy TCP, not conforming to the required sender-side congestion control window (even if the experimental higher initial window is considered). page 47

Summary SACK TCP provides additional information to the sender, allowing the reduction of needless retransmissions. There is no danger in providing this information, it simply serves to make a smarter TCP sender. D-SACK TCP allows the sender to determine when it has needlessly resent segments. This will allow the sender to continuously refine its retransmission strategy and undo unnecessary and incorrect congestion control mechanisms. Increasing the initial TCP window is a slight change that has advantages for both small and large data transfers, without significantly affecting the congestion control a smaller window provides. page 48