idnits 2.17.1 draft-ietf-tcpm-2140bis-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 252 has weird spacing: '...sthresh old_...' == Line 254 has weird spacing: '...nd_cwnd old_...' == Line 281 has weird spacing: '... MSSopt curr_...' == Line 291 has weird spacing: '...sthresh curr...' == Line 293 has weird spacing: '...nd_cwnd curr...' == (6 more instances...) == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (April 24, 2020) is 1456 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) -- Obsolete informational reference (is this intentional?): RFC 1644 (Obsoleted by RFC 6247) -- Obsolete informational reference (is this intentional?): RFC 1379 (Obsoleted by RFC 6247) -- Obsolete informational reference (is this intentional?): RFC 2001 (Obsoleted by RFC 2581) -- Obsolete informational reference (is this intentional?): RFC 2140 (Obsoleted by RFC 9040) -- Obsolete informational reference (is this intentional?): RFC 2414 (Obsoleted by RFC 3390) -- Obsolete informational reference (is this intentional?): RFC 2581 (Obsoleted by RFC 5681) -- Obsolete informational reference (is this intentional?): RFC 2861 (Obsoleted by RFC 7661) -- Obsolete informational reference (is this intentional?): RFC 4960 (Obsoleted by RFC 9260) -- Obsolete informational reference (is this intentional?): RFC 6824 (Obsoleted by RFC 8684) -- Obsolete informational reference (is this intentional?): RFC 7231 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 7540 (Obsoleted by RFC 9113) Summary: 1 error (**), 0 flaws (~~), 8 warnings (==), 13 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 TCPM WG J. Touch 2 Internet Draft Independent 3 Intended status: Informational M. Welzl 4 Obsoletes: 2140 S. Islam 5 Expires: October 2020 University of Oslo 6 April 24, 2020 8 TCP Control Block Interdependence 9 draft-ietf-tcpm-2140bis-03.txt 11 Status of this Memo 13 This Internet-Draft is submitted in full conformance with the 14 provisions of BCP 78 and BCP 79. 16 This document may contain material from IETF Documents or IETF 17 Contributions published or made publicly available before November 18 10, 2008. The person(s) controlling the copyright in some of this 19 material may not have granted the IETF Trust the right to allow 20 modifications of such material outside the IETF Standards Process. 21 Without obtaining an adequate license from the person(s) controlling 22 the copyright in such materials, this document may not be modified 23 outside the IETF Standards Process, and derivative works of it may 24 not be created outside the IETF Standards Process, except to format 25 it for publication as an RFC or to translate it into languages other 26 than English. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF), its areas, and its working groups. Note that 30 other groups may also distribute working documents as Internet- 31 Drafts. 33 Internet-Drafts are draft documents valid for a maximum of six 34 months and may be updated, replaced, or obsoleted by other documents 35 at any time. It is inappropriate to use Internet-Drafts as 36 reference material or to cite them other than as "work in progress." 38 The list of current Internet-Drafts can be accessed at 39 http://www.ietf.org/ietf/1id-abstracts.txt 41 The list of Internet-Draft Shadow Directories can be accessed at 42 http://www.ietf.org/shadow.html 44 This Internet-Draft will expire on October 24, 2020. 46 Copyright Notice 48 Copyright (c) 2020 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (https://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with 56 respect to this document. Code Components extracted from this 57 document must include Simplified BSD License text as described in 58 Section 4.e of the Trust Legal Provisions and are provided 59 without warranty as described in the Simplified BSD License. 61 Abstract 63 This memo provides guidance to TCP implementers that are intended to 64 help improve convergence to steady-state operation without affecting 65 interoperability. It updates and replaces RFC 2140's description of 66 interdependent TCP control blocks and the ways that part of TCP 67 state can be shared among similar concurrent or consecutive 68 connections. TCP state includes a combination of parameters, such as 69 connection state, current round-trip time estimates, congestion 70 control information, and process information. Most of this state is 71 maintained on a per-connection basis in the TCP Control Block (TCB), 72 but implementations can (and do) share certain TCB information 73 across connections to the same host. Such sharing is intended to 74 improve overall transient transport performance, while maintaining 75 backward-compatibility with existing implementations. The sharing 76 described herein is limited to only the TCB initialization and so 77 has no effect on the long-term behavior of TCP after a connection 78 has been established. 80 Table of Contents 82 1. Introduction...................................................3 83 2. Conventions Used in This Document..............................4 84 3. Terminology....................................................4 85 4. The TCP Control Block (TCB)....................................4 86 5. TCB Interdependence............................................5 87 6. Temporal Sharing...............................................6 88 6.1. Initialization of the new TCB................................6 89 6.2. Updates to the new TCB.......................................7 90 6.3. Discussion...................................................8 91 7. Ensemble Sharing...............................................9 92 7.1. Initialization of a new TCB..................................9 93 7.2. Updates to the new TCB......................................10 94 7.3. Discussion..................................................11 95 8. Compatibility Issues..........................................12 96 8.1. Traversing the same network path............................13 97 8.2. State dependence............................................13 98 8.3. Problems with IP sharing....................................14 99 9. Implications..................................................14 100 9.1. Layering....................................................14 101 9.2. Other possibilities.........................................15 102 10. Implementation Observations..................................15 103 11. Updates to RFC 2140..........................................16 104 12. Security Considerations......................................17 105 13. IANA Considerations..........................................17 106 14. References...................................................18 107 14.1. Normative References....................................18 108 14.2. Informative References..................................18 109 15. Acknowledgments..............................................21 110 16. Change log...................................................21 111 Appendix A : TCB Sharing History.................................24 112 Appendix B : TCP Option Sharing and Caching......................25 113 Appendix C : Automating the Initial Window in TCP over Long 114 Timescales.......................................................27 115 C.1. Introduction.............................................27 116 C.2. Design Considerations....................................27 117 C.3. Proposed IW Algorithm....................................28 118 C.4. Discussion...............................................31 119 C.5. Observations.............................................32 121 1. Introduction 123 TCP is a connection-oriented reliable transport protocol layered 124 over IP [RFC793]. Each TCP connection maintains state, usually in a 125 data structure called the TCP Control Block (TCB). The TCB contains 126 information about the connection state, its associated local 127 process, and feedback parameters about the connection's transmission 128 properties. As originally specified and usually implemented, most 129 TCB information is maintained on a per-connection basis. Some 130 implementations can (and now do) share certain TCB information 131 across connections to the same host [RFC2140]. Such sharing is 132 intended to lead to better overall transient performance, especially 133 for numerous short-lived and simultaneous connections, as often used 134 in the World-Wide Web [Be94][Br02]. This sharing of state is 135 intended to help TCP connections converge to steady-state behavior 136 more quickly without affecting TCP interoperability. 138 This document updates RFC 2140's discussion of TCB state sharing and 139 provides a complete replacement for that document. This state 140 sharing affects only TCB initialization [RFC2140] and thus has no 141 effect on the long-term behavior of TCP after a connection has been 142 established nor on interoperability. Path information shared across 143 SYN destination port numbers assumes that TCP segments having the 144 same host-pair experience the same path properties, irrespective of 145 TCP port numbers. The observations about TCB sharing in this 146 document apply similarly to any protocol with congestion state, 147 including SCTP [RFC4960] and DCCP [RFC4340], as well as for 148 individual subflows in Multipath TCP [RFC6824]. 150 2. Conventions Used in This Document 152 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 153 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 154 "OPTIONAL" in this document are to be interpreted as described in 155 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 156 capitals, as shown here. 158 However, this document is intended to describe behavior that is 159 already permitted by TCP standards. As a result, it provides 160 informative guidance but does not use such normative language, 161 except when quoting other documents. 163 3. Terminology 165 Host - a source or sink of TCP segments associated with a single IP 166 address 168 Host-pair - a pair of hosts and their corresponding IP addresses 170 Path - an Internet path between the IP addresses of two hosts 172 4. The TCP Control Block (TCB) 174 A TCB describes the data associated with each connection, i.e., with 175 each association of a pair of applications across the network. The 176 TCB contains at least the following information [RFC793]: 178 Local process state 179 pointers to send and receive buffers 180 pointers to retransmission queue and current segment 181 pointers to Internet Protocol (IP) PCB 182 Per-connection shared state 183 macro-state 184 connection state 185 timers 186 flags 187 local and remote host numbers and ports 188 TCP option state 189 micro-state 190 send and receive window state (size*, current number) 191 cong. window size (snd_cwnd)* 192 cong. window size threshold (ssthresh)* 193 max window size seen* 194 sendMSS# 195 MMS_S# 196 MMS_R# 197 PMTU# 198 round-trip time and variance# 200 The per-connection information is shown as split into macro-state 201 and micro-state, terminology borrowed from [Co91]. Macro-state 202 describes the protocol for establishing the initial shared state 203 about the connection; we include the endpoint numbers and components 204 (timers, flags) required upon commencement that are later used to 205 help maintain that state. Micro-state describes the protocol after a 206 connection has been established, to maintain the reliability and 207 congestion control of the data transferred in the connection. 209 We further distinguish two other classes of shared micro-state that 210 are associated more with host-pairs than with application pairs. One 211 class is clearly host-pair dependent (#, e.g., MSS, MMS, PMTU, RTT), 212 and the other is host-pair dependent in its aggregate (*, e.g., 213 congestion window information, current window sizes, etc.). 215 5. TCB Interdependence 217 There are two cases of TCB interdependence. Temporal sharing occurs 218 when the TCB of an earlier (now CLOSED) connection to a host is used 219 to initialize some parameters of a new connection to that same host, 220 i.e., in sequence. Ensemble sharing occurs when a currently active 221 connection to a host is used to initialize another (concurrent) 222 connection to that host. 224 6. Temporal Sharing 226 The TCB data cache is accessed in two ways: it is read to initialize 227 new TCBs and written when more current per-host state is available. 229 6.1. Initialization of the new TCB 231 TCBs for new connections can be initialized using context from past 232 connections as follows: 234 TEMPORAL SHARING - TCB Initialization 236 Cached TCB New TCB 237 -------------------------------------- 238 old_MMS_S old_MMS_S or not cached 240 old_MMS_R old_MMS_R or not cached 242 old_sendMSS old_sendMSS 244 old_PMTU old_PMTU 246 old_RTT old_RTT 248 old_RTTvar old_RTTvar 250 old_option (option specific) 252 old_ssthresh old_ssthresh 254 old_snd_cwnd old_snd_cwnd 256 The table below gives an overview of option-specific information 257 that can be shared. Additional information on some specific TCP 258 options and sharing is provided in 0. 260 TEMPORAL SHARING - Option Info Initialization 262 Cached New 263 ---------------------------------------- 264 old_TFO_Cookie old_TFO_Cookie 266 old_TFO_Failure old_TFO_Failure 268 6.2. Updates to the new TCB 270 During the connection, the associated TCB can be updated based on 271 particular events, as shown below: 273 TEMPORAL SHARING - Cache Updates 275 Cached TCB Current TCB when? New Cached TCB 276 ------------------------------------------------------ 277 old_MMS_S curr_ MMS_S OPEN curr MMS_S 279 old_MMS_R curr_ MMS_R OPEN curr_MMS_R 281 old_sendMSS curr_sendMSS MSSopt curr_sendMSS 283 old_PMTU curr_PMTU PMTUD curr_PMTU 285 old_RTT curr_RTT CLOSE merge(curr,old) 287 old_RTTvar curr_RTTvar CLOSE merge(curr,old) 289 old_option curr option ESTAB (depends on option) 291 old_ssthresh curr_ssthresh CLOSE merge(curr,old) 293 old_snd_cwnd curr_snd_cwnd CLOSE merge(curr,old) 295 The table below gives an overview of option-specific information 296 that can be similarly shared. 298 TEMPORAL SHARING - Option Info Updates 300 Cached Current when? New Cached 301 ---------------------------------------------------------------- 302 old_TFO_Cookie old_TFO_Cookie ESTAB old_TFO_Cookie 304 old_TFO_Failure old_TFO_Failure ESTAB old_TFO_Failure 306 6.3. Discussion 308 There is no particular benefit to caching MMS_S and MMS R as these 309 are reported by the local IP stack. Caching sendMSS and PMTU is 310 trivial; reported values are cached, and the most recent values are 311 used. The cache is updated when the MSS option is received in a SYN 312 or after PMTUD (i.e., when an ICMPv4 Fraqmentation Needed [RFC1191] 313 or ICMPv6 Packet Too Big message is received [RFC8201] or the 314 equivalent is inferred, e.g. as from PLPMTUD [RFC4821]), 315 respectively, so the cache always has the most recent values from 316 any connection. For sendMSS, the cache is consulted only at 317 connection establishment and not otherwise updated, which means that 318 MSS options do not affect current connections. The default sendMSS 319 is never saved; only reported MSS values update the cache, so an 320 explicit override is required to reduce the sendMSS. 322 RTT values are updated by formulae that merge the old and new 323 values. Dynamic RTT estimation requires a sequence of RTT 324 measurements. As a result, the cached RTT (and its variance) is an 325 average of its previous value with the contents of the currently 326 active TCB for that host, when a TCB is closed. RTT values are 327 updated only when a connection is closed. The method for merging old 328 and current values needs to attempt to reduce the transient effects 329 of the new connections. 331 The updates for RTT, RTTvar and ssthresh rely on existing 332 information, i.e., old values. Should no such values exist, the 333 current values are cached instead. 335 TCP options are copied or merged depending on the details of each 336 option, where "merge" is some function that combines the values of 337 "curr" and "old". E.g., TFO state is updated when a connection is 338 established and read before establishing a new connection. 340 Sections 8 and 9 discuss compatibility issues and implications of 341 sharing the specific information listed above. Section 10 gives an 342 overview of known implementations. 344 Most cached TCB values are updated when a connection closes. The 345 exceptions are MMS_R and MMS_S, which are reported by IP [RFC1122], 346 PMTU which is updated after Path MTU Discovery 347 [RFC1191][RFC4821][RFC8201], and sendMSS, which is updated if the 348 MSS option is received in the TCP SYN header. 350 Sharing sendMSS information affects only data in the SYN of the next 351 connection, because sendMSS information is typically included in 352 most TCP SYN segments. Caching PMTU can accelerate the efficiency of 353 PMTUD, but can also result in black-holing until corrected if in 354 error. Caching MMS_R and MMS_S may be of little direct value as they 355 are reported by the local IP stack anyway. 357 The way in which other TCP option state can be shared depends on the 358 details of that option. E.g., TFO state includes the TCP Fast Open 359 Cookie [RFC7413] or, in case TFO fails, a negative TCP Fast Open 360 response. RFC 7413 states, "The client MUST cache negative responses 361 from the server in order to avoid potential connection failures. 362 Negative responses include the server not acknowledging the data in 363 the SYN, ICMP error messages, and (most importantly) no response 364 (SYN-ACK) from the server at all, i.e., connection timeout." [RFC 365 7413]. TFOinfo is cached when a connection is established. 367 Other TCP option state might not be as readily cached. E.g., TCP-AO 368 [RFC5925] success or failure between a host pair for a single SYN 369 destination port might be usefully cached. TCP-AO success or failure 370 to other SYN destination ports on that host pair is never useful to 371 cache because TCP-AO security parameters can vary per service. 373 7. Ensemble Sharing 375 Sharing cached TCB data across concurrent connections requires 376 attention to the aggregate nature of some of the shared state. For 377 example, although MSS and RTT values can be shared by copying, it 378 may not be appropriate to simply copy congestion window or ssthresh 379 information; instead, the new values can be a function (f) of the 380 cumulative values and the number of connections (N). 382 7.1. Initialization of a new TCB 384 TCBs for new connections can be initialized using context from 385 concurrent connections as follows: 387 ENSEMBLE SHARING - TCB Initialization 389 Cached TCB New TCB 390 -------------------------------- 391 old_MMS_S old_MMS_S 393 old_MMS_R old_MMS_R 395 old_sendMSS old_sendMSS 397 old_PMTU old_PMTU 399 old_RTT old_RTT 401 old_RTTvar old_RTTvar 403 old ssthresh sum f(old ssthresh sum, N) 405 old snd_cwnd sum f(old snd cwnd sum, N) 407 old_option (option-specific) 409 The table below gives an overview of option-specific information 410 that can be similarly shared. 412 ENSEMBLE SHARING - Option Info Initialization 414 Cached New 415 ---------------------------------------- 416 old_TFO_Cookie old_TFO_Cookie 418 old_TFO_Failure old_TFO_Failure 420 7.2. Updates to the new TCB 422 During the connection, the associated TCB can be updated based on 423 changes to concurrent connections, as shown below: 425 ENSEMBLE SHARING - Cache Updates 427 Cached TCB Current TCB when? New Cached TCB 428 ----------------------------------------------------- 429 old_MMS_S curr_MMS_S OPEN curr_MMS_S 431 old_MMS_R curr_MMS_R OPEN curr_MMS_R 433 old_sendMSS curr_sendMSS MSSopt curr_sendMSS 435 old_PMTU curr_PMTU PMTUD curr_PMTU 436 /PLPMTUD 438 old_RTT curr_RTT update rtt_update(old,curr) 440 old_RTTvar curr_RTTvar update rtt_update(old,curr) 442 old ssthresh curr ssthresh update adjust sum as appopriate 444 old snd_cwnd curr snd_cwnd update adjust sum as appopriate 446 old_option curr option (depends) (option specific) 448 The table below gives an overview of option-specific information 449 that can be similarly shared. 451 ENSEMBLE SHARING - Option Info Updates 453 Cached Current when? New Cached 454 ---------------------------------------------------------------- 455 old_TFO_Cookie old_TFO_Cookie ESTAB old_TFO_Cookie 457 old_TFO_Failure old_TFO_Failure ESTAB old_TFO_Failure 459 7.3. Discussion 461 For ensemble sharing, TCB information should be cached as early as 462 possible, sometimes before a connection is closed. Otherwise, 463 opening multiple concurrent connections may not result in TCB data 464 sharing if no connection closes before others open. The amount of 465 work involved in updating the aggregate average should be minimized, 466 but the resulting value should be equivalent to having all values 467 measured within a single connection. The function "rtt_update" in 468 the ensemble sharing table indicates this operation, which occurs 469 whenever the RTT would have been updated in the individual TCP 470 connection. As a result, the cache contains the shared RTT 471 variables, which no longer need to reside in the TCB. 473 Congestion window size and ssthresh aggregation are more complicated 474 in the concurrent case. When there is an ensemble of connections, we 475 need to decide how that ensemble would have shared these variables, 476 in order to derive initial values for new TCBs. 478 Sections 8 and 9 discuss compatibility issues and implications of 479 sharing the specific information listed above. 481 Any assumption of TCB information sharing can be incorrect because 482 identical endpoint address pairs may not share network paths. In 483 current implementations, new congestion windows are set at an 484 initial value of 4-10 segments [RFC3390][RFC6928], so that the sum 485 of the current windows is increased for any new connection. This can 486 have detrimental consequences where several connections share a 487 highly congested link. 489 There are several ways to initialize the congestion window in a new 490 TCB among an ensemble of current connections to a host. Current TCP 491 implementations initialize it to four segments as standard [rfc3390] 492 and 10 segments experimentally [RFC6928]. These approaches assume 493 that new connections should behave as conservatively as possible. 494 The algorithm described in [Ba12] adjusts the initial cwnd depending 495 on the cwnd values of ongoing connections. There have also been 496 suggestions to use the kind of sharing mechanisms described in this 497 document over long timescales to adapt TCP's initial window 498 automatically, as described further in Appendix A [To12]. 500 8. Compatibility Issues 502 Here, we discuss various types of problems that may arise with TCB 503 information sharing. 505 For the congestion and current window information, the initial 506 values computed by TCB interdependence may not be consistent with 507 the long-term aggregate behavior of a set of concurrent connections 508 between the same endpoints. Under conventional TCP congestion 509 control, if a single existing connection has converged to a 510 congestion window of 40 segments, two newly joining concurrent 511 connections assume initial windows of 10 segments [RFC6928], and the 512 current connection's window doesn't decrease to accommodate this 513 additional load and connections can mutually interfere. One example 514 of this is seen on low-bandwidth, high-delay links, where concurrent 515 connections supporting Web traffic can collide because their initial 516 windows were too large, even when set at one segment. 518 The authors of [Hu12] recommend caching ssthresh for temporal 519 sharing only when flows are long. Some studies suggest that sharing 520 ssthresh between short flows can deteriorate the performance of 521 individual connections [Hu12, Du16], although this may benefit 522 aggregate network performance. 524 8.1. Traversing the same network path 526 TCP is sometimes used in situations where packets of the same host- 527 pair do not always take the same path. Multipath routing that relies 528 on examining transport headers, such as ECMP and LAG [RFC7424], may 529 not result in repeatable path selection when TCP segments are 530 encapsulated, encrypted, or altered - for example, in some Virtual 531 Private Network (VPN) tunnels that rely on proprietary 532 encapsulation. Similarly, such approaches cannot operate 533 deterministically when the TCP header is encrypted, e.g., when using 534 IPsec ESP (although TCB interdependence among the entire set sharing 535 the same endpoint IP addresses should work without problems when the 536 TCP header is encrypted). Measures to increase the probability that 537 connections use the same path could be applied: e.g., the 538 connections could be given the same IPv6 flow label. TCB 539 interdependence can also be extended to sets of host IP address 540 pairs that share the same network path conditions, such as when a 541 group of addresses is on the same LAN (see Section 9). 543 Traversing the same path is not important for host-specific 544 information such as RWIN and TCP option state, such as TFOinfo. When 545 TCB information is shared across different SYN destination ports, 546 path-related information can be incorrect; however, the impact of 547 this error is potentially diminished if (as discussed here) TCB 548 sharing affects only the transient event of a connection start or if 549 TCB information is shared only within connections to the same SYN 550 destination port. In case of Temporal Sharing, TCB information could 551 also become invalid over time. Because this is similar to the case 552 when a connection becomes idle, mechanisms that address idle TCP 553 connections (e.g., [RFC7661]) could also be applied to TCB cache 554 management, especially when TCP Fast Open is used [RFC7413]. 556 8.2. State dependence 558 There may be additional considerations to the way in which TCB 559 interdependence rebalances congestion feedback among the current 560 connections, e.g., it may be appropriate to consider the impact of a 561 connection being in Fast Recovery [RFC5681] or some other similar 562 unusual feedback state, e.g., as inhibiting or affecting the 563 calculations described herein. 565 8.3. Problems with IP sharing 567 It can be wrong to share TCB information between TCP connections on 568 the same host as identified by the IP address if an IP address is 569 assigned to a new host (e.g., IP address spinning, as is used by 570 ISPs to inhibit running servers). It can be wrong if Network Address 571 (and Port) Translation (NA(P)T) [RFC2663] or any other IP sharing 572 mechanism is used. Such mechanisms are less likely to be used with 573 IPv6. Other methods to identify a host could also be considered to 574 make correct TCB sharing more likely. Moreover, some TCB information 575 is about dominant path properties rather than the specific host. IP 576 addresses may differ, yet the relevant part of the path may be the 577 same. 579 9. Implications 581 There are several implications to incorporating TCB interdependence 582 in TCP implementations. First, it may reduce the need for 583 application-layer multiplexing for performance enhancement 584 [RFC7231]. Protocols like HTTP/2 [RFC7540] avoid connection 585 reestablishment costs by serializing or multiplexing a set of per- 586 host connections across a single TCP connection. This avoids TCP's 587 per-connection OPEN handshake and also avoids recomputing the MSS, 588 RTT, and congestion window values. By avoiding the so-called, "slow- 589 start restart," performance can be optimized [Hu01]. TCB 590 interdependence can provide the "slow-start restart avoidance" of 591 multiplexing, without requiring a multiplexing mechanism at the 592 application layer. 594 Like the initial version of this document [RFC2140], this update's 595 approach to TCB interdependence focuses on sharing a set of TCBs by 596 updating the TCB state to reduce the impact of transients when 597 connections begin or end. Other mechanisms have since been proposed 598 to continuously share information between all ongoing communication 599 (including connectionless protocols), updating the congestion state 600 during any congestion-related event (e.g., timeout, loss 601 confirmation, etc.) [RFC3124]. By dealing exclusively with 602 transients, TCB interdependence is more likely to exhibit the same 603 behavior as unmodified, independent TCP connections. 605 9.1. Layering 607 TCB interdependence pushes some of the TCP implementation from the 608 traditional transport layer (in the ISO model), to the network 609 layer. This acknowledges that some state is in fact per-host-pair or 610 can be per-path as indicated solely by that host-pair. Transport 611 protocols typically manage per-application-pair associations (per 612 stream), and network protocols manage per-host-pair and path 613 associations (routing). Round-trip time, MSS, and congestion 614 information could be more appropriately handled in a network-layer 615 fashion, aggregated among concurrent connections, and shared across 616 connection instances [RFC3124]. 618 An earlier version of RTT sharing suggested implementing RTT state 619 at the IP layer, rather than at the TCP layer. Our observations 620 describe sharing state among TCP connections, which avoids some of 621 the difficulties in an IP-layer solution. One such problem of an IP 622 layer solution is determining the correspondence between packet 623 exchanges using IP header information alone, where such 624 correspondence is needed to compute RTT. Because TCB sharing 625 computes RTTs inside the TCP layer using TCP header information, it 626 can be implemented more directly and simply than at the IP layer. 627 This is a case where information should be computed at the transport 628 layer but could be shared at the network layer. 630 9.2. Other possibilities 632 Per-host-pair associations are not the limit of these techniques. It 633 is possible that TCBs could be similarly shared between hosts on a 634 subnet or within a cluster, because the predominant path can be 635 subnet-subnet, rather than host-host. Additionally, TCB 636 interdependence can be applied to any protocol with congestion 637 state, including SCTP [RFC4960] and DCCP [RFC4340], as well as for 638 individual subflows in Multipath TCP [RFC6824]. 640 There may be other information that can be shared between concurrent 641 connections. For example, knowing that another connection has just 642 tried to expand its window size and failed, a connection may not 643 attempt to do the same for some period. The idea is that existing 644 TCP implementations infer the behavior of all competing connections, 645 including those within the same host or subnet. One possible 646 optimization is to make that implicit feedback explicit, via 647 extended information associated with the endpoint IP address and its 648 TCP implementation, rather than per-connection state in the TCB. 650 10. Implementation Observations 652 The observation that some TCB state is host-pair specific rather 653 than application-pair dependent is not new and is a common 654 engineering decision in layered protocol implementations. Although 655 now deprecated, T/TCP [RFC1644] was the first to propose using 656 caches in order to maintain TCB states (see Appendix A for more 657 information). 659 The table below describes the current implementation status for some 660 TCB information in Linux kernel version 4.6, FreeBSD 10 and Windows 661 (as of October 2016). In the table, "shared" only refers to temporal 662 sharing. 664 CURRENT IMPLEMENTATION STATUS (as of 2016) 666 TCB data Status 667 ----------------------------------------------------------- 668 old MMS_S Not shared 670 old MMS_R Not shared 672 old_sendMSS Cached and shared in Linux (MSS) 674 old PMTU Cached and shared in FreeBSD and Windows (PMTU) 676 old_RTT Cached and shared in FreeBSD and Linux 678 old_RTTvar Cached and shared in FreeBSD 680 old TFOinfo Cached and shared in Linux and Windows 682 old_snd_cwnd Not shared 684 old_ssthresh Cached and shared in FreeBSD and Linux: 685 FreeBSD: arithmetic 686 mean of ssthresh and previous value if 687 a previous value exists; 688 Linux: depending on state, 689 max(cwnd/2, ssthresh) in most cases 691 11. Updates to RFC 2140 693 This document updates the description of TCB sharing in RFC 2140 and 694 its associated impact on existing and new connection state, 695 providing a complete replacement for that document [RFC2140]. It 696 clarifies the previous description and terminology and extends the 697 mechanism to its impact on new protocols and mechanisms, including 698 multipath TCP, fast open, PLPMTUD, NAT, and the TCP Authentication 699 Option. 701 The detailed impact on TCB state addresses TCB parameters in greater 702 detail, addressing RSS in both the send and receive direction, MSS 703 and send-MSS separately, adds path MTU and ssthresh, and addresses 704 the impact on TCP option state. 706 New sections have been added to address compatibility issues and 707 implementation observations. The relation of this work to T/TCP has 708 been moved to Appendix A on history, partly to reflect the 709 deprecation of that protocol. 711 Appendix C has been added to discuss the potential to use temporal 712 sharing over long timescales to adapt TCP's initial window 713 automatically, largely imported from [To12]. 715 Finally, this document updates and significantly expands the 716 referenced literature. 718 12. Security Considerations 720 These presented implementation methods do not have additional 721 ramifications for explicit attacks. They may be susceptible to 722 denial-of-service attacks if not otherwise secured. 724 TCB sharing may be susceptible to denial-of-service attacks, 725 wherever the TCB is shared, between connections in a single host, or 726 between hosts if TCB sharing is implemented within a subnet (see 727 Implications section). Some shared TCB parameters are used only to 728 create new TCBs, others are shared among the TCBs of ongoing 729 connections. New connections can join the ongoing set, e.g., to 730 optimize send window size among a set of connections to the same 731 host. 733 Attacks on parameters used only for initialization affect only the 734 transient performance of a TCP connection. For short connections, 735 the performance ramification can approach that of a denial-of- 736 service attack. E.g., if an application changes its TCB to have a 737 false and small window size, subsequent connections would experience 738 performance degradation until their window grew appropriately. 740 TCB sharing reuses and mixes information from past and current 741 connections. Although reusing information could create a potential 742 for fingerprinting to identify hosts, the mixing reduces that 743 potential. There has been no evidence of fingerprinting based on 744 this technique and it is currently considered safe in that regard. 746 13. IANA Considerations 748 There are no IANA implications or requests in this document. 750 This section should be removed upon final publication as an RFC. 752 14. References 754 14.1. Normative References 756 [RFC793] Postel, Jon, "Transmission Control Protocol," Network 757 Working Group RFC-793/STD-7, ISI, Sept. 1981. 759 [RFC1122] Braden, R. (ed), "Requirements for Internet Hosts -- 760 Communication Layers", RFC-1122, Oct. 1989. 762 [RFC1191] Mogul, J., Deering, S., "Path MTU Discovery," RFC 1191, 763 Nov. 1990. 765 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 766 Requirement Levels", BCP 14, RFC 2119, March 1997. 768 [RFC4821] Mathis, M., Heffner, J., "Packetization Layer Path MTU 769 Discovery," RFC 4821, Mar. 2007. 771 [RFC5681] Allman, M., Paxson, V., Blanton, E., "TCP Congestion 772 Control," RFC 5681 (Standards Track), Sep. 2009. 774 [RFC7413] Cheng, Y., Chu, J., Radhakrishnan, S., Jain, A., "TCP Fast 775 Open", RFC 7413, Dec. 2014. 777 [RFC8174] Leiba., B., "Ambiguity of Uppercase vs Lowercase in RFC 778 2119 Key Words", RFC 8174, May 2017. 780 [RFC8201] McCann, J., Deering. S., Mogul, J., Hinden, R. (Ed.), 781 "Path MTU Discovery for IP version 6," RFC 8201, Jul. 782 2017. 784 14.2. Informative References 786 [Al10] Allman, M., "Initial Congestion Window Specification", 787 (work in progress), draft-allman-tcpm-bump-initcwnd-00, 788 Nov. 2010. 790 [Ba12] Barik, R., Welzl, M., Ferlin, S., Alay, O., " LISA: A 791 Linked Slow-Start Algorithm for MPTCP", IEEE ICC, Kuala 792 Lumpur, Malaysia, May 23-27 2016. 794 [Be94] Berners-Lee, T., et al., "The World-Wide Web," 795 Communications of the ACM, V37, Aug. 1994, pp. 76-82. 797 [Br94] Braden, B., "T/TCP -- Transaction TCP: Source Changes for 798 Sun OS 4.1.3,", Release 1.0, USC/ISI, September 14, 1994. 800 [Br02] Brownlee, N. and K. Claffy, "Understanding Internet 801 Traffic Streams: Dragonflies and Tortoises", IEEE 802 Communications Magazine p110-117, 2002. 804 [Co91] Comer, D., Stevens, D., Internetworking with TCP/IP, V2, 805 Prentice-Hall, NJ, 1991. 807 [Du16] Dukkipati, N., Yuchung C., and Amin V., "Research 808 Impacting the Practice of Congestion Control." ACM SIGCOMM 809 CCR (editorial), on-line post, July 2016. 811 [FreeBSD] FreeBSD source code, Release 2.10, http://www.freebsd.org/ 813 [Hu01] Hugues, A., Touch, J., Heidemann, J., "Issues in Slow- 814 Start Restart After Idle", draft-hughes-restart-00 815 (expired), Dec. 2001. 817 [Hu12] Hurtig, P., Brunstrom, A., "Enhanced metric caching for 818 short TCP flows," 2012 IEEE International Conference on 819 Communications (ICC), Ottawa, ON, 2012, pp. 1209-1213. 821 [Ja88] Jacobson, V., M. Karels, "Congestion Avoidance and 822 Control", Proc. Sigcomm 1988. 824 [RFC1644] Braden, R., "T/TCP -- TCP Extensions for Transactions 825 Functional Specification," RFC-1644, July 1994. 827 [RFC1379] Braden, R., "Transaction TCP -- Concepts," RFC-1379, 828 September 1992. 830 [RFC2001] Stevens, W., "TCP Slow Start, Congestion Avoidance, Fast 831 Retransmit, and Fast Recovery Algorithms", RFC2001 832 (Standards Track), Jan. 1997. 834 [RFC2140] Touch, J., "TCP Control Block Interdependence", RFC 2140, 835 April 1997. 837 [RFC2414] Allman, M., Floyd, S., Partridge, C., "Increasing TCP's 838 Initial Window", RFC 2414 (Experimental), Sept. 1998. 840 [RFC2581] Allman, M., Paxson, V., Stevens, W., "TCP Congestion 841 Control," RFC2581 (Standards Track), Apr. 1999. 843 [RFC2663] Srisuresh, P., Holdrege, M., "IP Network Address 844 Translator (NAT) Terminology and Considerations", RFC- 845 2663, August 1999. 847 [RFC2861] Handley, M., Padhye, J., Floyd, S., "TCP Congestion Window 848 Validation", RFC2861 (Experimental), June 2000. 850 [RFC3390] Allman, M., Floyd, S., Partridge, C., "Increasing TCP's 851 Initial Window," RFC 3390, Oct. 2002. 853 [RFC3124] Balakrishnan, H., Seshan, S., "The Congestion Manager," 854 RFC 3124, June 2001. 856 [RFC4340] Kohler, E., Handley, M., Floyd, S., "Datagram Congestion 857 Control Protocol (DCCP)," RFC 4340, Mar. 2006. 859 [RFC4960] Stewart, R., (Ed.), "Stream Control Transmission 860 Protocol," RFC4960, Sept. 2007. 862 [RFC5925] Touch, J., Mankin, A., Bonica, R., "The TCP Authentication 863 Option," RFC 5925, June 2010. 865 [RFC6824] Ford, A., Raiciu, C., Handley, M., Bonaventure, O., "TCP 866 Extensions for Multipath Operation with Multiple 867 Addresses," RFC 6824, Jan. 2013. 869 [RFC6928] Chu, J., Dukkipati, N., Cheng, Y., Mathis, M., "Increasing 870 TCP's Initial Window," RFC 6928, Apr. 2013. 872 [RFC7231] Fielding, R., J. Reshke, Eds., "HTTP/1.1 Semantics and 873 Content," RFC-7231, June 2014. 875 [RFC7323] Borman, D., B. Braden, V. Jacobson, R. Scheffenegger 876 (Ed.), "TCP Extensions for High Performance," RFC 7323, 877 Sept. 2014. 879 [RFC7424] Krishnan, R., Yong, L., Ghanwani, A., So, N., Khasnabish, 880 B., "Mechanisms for Optimizing Link Aggregation Group 881 (LAG) and Equal-Cost Multipath (ECMP) Component Link 882 Utilization in Networks", RFC 7424, Jan. 2015 884 [RFC7540] Belshe, M., Peon, R., Thomson, M., "Hypertext Transfer 885 Protocol Version 2 (HTTP/2)", RFC 7540, May 2015. 887 [RFC7661] Fairhurst, G., Sathiaseelan, A., Secchi, R., "Updating TCP 888 to Support Rate-Limited Traffic", RFC 7661, Oct. 2015. 890 [To12] Touch, J., "Automating the Initial Window in TCP," draft- 891 touch-tcpm-automatic-iw-03 (expired), July 2012. 893 15. Acknowledgments 895 The authors would like to thank for Praveen Balasubramanian for 896 information regarding TCB sharing in Windows, and Yuchung Cheng, 897 Lars Eggert, Ilpo Jarvinen and Michael Scharf for comments on 898 earlier versions of the draft. Earlier revisions of this work 899 received funding from a collaborative research project between the 900 University of Oslo and Huawei Technologies Co., Ltd. and were partly 901 supported by USC/ISI's Postel Center. 903 This document was prepared using 2-Word-v2.0.template.dot. 905 16. Change log 907 This section should be removed upon final publication as an RFC. 909 ietf-02: 911 - Minor reorganization and correction of typographic errors 912 - Added text to address fingerprinting in Security section 913 - Now retains Appendix B and body option tables upon publication 915 ietf-01: 917 - Added Appendix C to address long-timescale temporal adaptation. 919 ietf-00: 921 - Re-issued as draft-ietf-tcpm-2140bis due to WG adoption. 922 - Cleaned orphan references to T/TCP, removed incomplete refs 923 - Moved references to informative section and updated Sec 2 924 - Updated to clarify no impact to interoperability 925 - Updated appendix B to avoid 2119 language 927 06: 929 - Changed to update 2140, cite it normatively, and summarize the 930 updates in a separate section 932 05: 934 - Fixed some TBDs. 936 04: 938 - Removed BCP-style recommendations and fixed some TBDs. 940 03: 942 - Updated Touch's affiliation and address information 944 02: 946 - Stated that our OS implementation overview table only covers 947 temporal sharing. 949 - Correctly reflected sharing of old_RTT in Linux in the 950 implementation overview table. 952 - Marked entries that are considered safe to share with an 953 asterisk (suggestion was to split the table) 955 - Discussed correct host identification: NATs may make IP 956 addresses the wrong input, could e.g. use HTTP cookie. 958 - Included MMS_S and MMS_R from RFC1122; fixed the use of MSS and 959 MTU 961 - Added information about option sharing, listed options in 0 963 Authors' Addresses 965 Joe Touch 966 Manhattan Beach, CA 90266 967 USA 969 Phone: +1 (310) 560-0334 970 Email: touch@strayalpha.com 972 Michael Welzl 973 University of Oslo 974 PO Box 1080 Blindern 975 Oslo N-0316 976 Norway 978 Phone: +47 22 85 24 20 979 Email: michawe@ifi.uio.no 980 Safiqul Islam 981 University of Oslo 982 PO Box 1080 Blindern 983 Oslo N-0316 984 Norway 986 Phone: +47 22 84 08 37 987 Email: safiquli@ifi.uio.no 989 Appendix A: TCB Sharing History 991 T/TCP proposed using caches to maintain TCB information across 992 instances (temporal sharing), e.g., smoothed RTT, RTT variance, 993 congestion avoidance threshold, and MSS [RFC1644]. These values were 994 in addition to connection counts used by T/TCP to accelerate data 995 delivery prior to the full three-way handshake during an OPEN. The 996 goal was to aggregate TCB components where they reflect one 997 association - that of the host-pair, rather than artificially 998 separating those components by connection. 1000 At least one T/TCP implementation saved the MSS and aggregated the 1001 RTT parameters across multiple connections but omitted caching the 1002 congestion window information [Br94], as originally specified in 1003 [RFC1379]. Some T/TCP implementations immediately updated MSS when 1004 the TCP MSS header option was received [Br94], although this was not 1005 addressed specifically in the concepts or functional specification 1006 [RFC1379][RFC1644]. In later T/TCP implementations, RTT values were 1007 updated only after a CLOSE, which does not benefit concurrent 1008 sessions. 1010 Temporal sharing of cached TCB data was originally implemented in 1011 the SunOS 4.1.3 T/TCP extensions [Br94] and the FreeBSD port of same 1012 [FreeBSD]. As mentioned before, only the MSS and RTT parameters were 1013 cached, as originally specified in [RFC1379]. Later discussion of 1014 T/TCP suggested including congestion control parameters in this 1015 cache; for example, [RFC1644] (Section 3.1) hints at initializing 1016 the congestion window to the old window size. 1018 Appendix B: TCP Option Sharing and Caching 1020 In addition to the options that can be cached and shared, this memo 1021 also lists known options for which state is unsafe to be kept. This 1022 list is not intended to be authoritative or exhaustive. 1024 Obsolete (unsafe to keep state): 1026 ECHO 1028 ECHO REPLY 1030 PO Conn permitted 1032 PO service profile 1034 CC 1036 CC.NEW 1038 CC.ECHO 1040 Alt CS req 1042 Alt CS data 1044 No state to keep: 1046 EOL 1048 NOP 1050 WS 1052 SACK 1054 TS 1056 MD5 1058 TCP-AO 1060 EXP1 1062 EXP2 1064 Unsafe to keep state: 1066 Skeeter (DH exchange, known to be vulnerable) 1068 Bubba (DH exchange, known to be vulnerable) 1070 Trailer CS 1072 SCPS capabilities 1074 S-NACK 1076 Records boundaries 1078 Corruption experienced 1080 SNAP 1082 TCP Compression 1084 Quickstart response 1086 UTO 1088 MPTCP negotiation success (see below for negotiation failure) 1090 TFO negotiation success (see below for negotiation failure) 1092 Safe but optional to keep state: 1094 MPTCP negotiation failure (to avoid negotiation retries) 1096 MSS 1098 TFO negotiation failure (to avoid negotiation retries) 1100 Safe and necessary to keep state: 1102 TFP cookie (if TFO succeeded in the past) 1104 Appendix C: Automating the Initial Window in TCP over Long Timescales 1106 Note: this section is taken verbatim from [To12], updated to refer 1107 to itself as an appendix. 1109 C.1. Introduction 1111 TCP's congestion control algorithm uses an initial window value 1112 (IW), both as a starting point for new connections and after one RTO 1113 or more [RFC2581][RFC2861]. This value has evolved over time, 1114 originally one maximum segment size (MSS), and increased to the 1115 lesser of four MSS or 4,380 bytes [RFC3390][RFC5681]. For typical 1116 Internet connections with an maximum transmission units (MTUs) of 1117 1500 bytes, this permits three segments of 1,460 bytes each. 1119 The IW value was originally implied in the original TCP congestion 1120 control description, and documented as a standard in 1997 1121 [RFC2001][Ja88]. The value was last updated in 1998 experimentally, 1122 and moved to the standards track in 2002 [RFC2414][RFC3390]. There 1123 have been recent proposals to update the IW based on further 1124 increases in host and router capabilities and network capacity, some 1125 focusing on specific values (e.g., IW=10), and others prescribing a 1126 schedule for increases over time (e.g., IW=6 for 2011, increasing by 1127 1-2 MSS per year). 1129 This appendix discusses how TCP can objectively measure when an IW 1130 is too large, and that such feedback should be used over long 1131 timescales to adjust the IW automatically. The result should be 1132 safer to deploy and might avoid the need to repeatedly revisit IW 1133 size over time. 1135 Note that this mechanism attempts to make the IW more adaptive over 1136 time. It can increase the IW beyond that which is currently 1137 recommended for widescale deployment, and so its use should be 1138 carefully monitored. 1140 C.2. Design Considerations 1142 TCP's IW value has existed statically for over two decades, so any 1143 solution to adjusting the IW dynamically should have similarly 1144 stable, non-invasive effects on the performance and complexity of 1145 TCP. In order to be fair, the IW should be similar for most machines 1146 on the public Internet. Finally, a desirable goal is to develop a 1147 self-correcting algorithm, so that IW values that cause network 1148 problems can be avoided. To that end, we propose the following list 1149 of design goals: 1151 o Impart little to no impact to TCP in the absence of loss, i.e., 1152 it should not increase the complexity of default packet 1153 processing in the normal case. 1155 o Adapt to network feedback over long timescales, avoiding values 1156 that persistently cause network problems. 1158 o Decrease the IW in the presence of sustained loss of IW segments, 1159 as determined over a number of different connections. 1161 o Increase the IW in the absence of sustained loss of IW segments, 1162 as determined over a number of different connections. 1164 o Operate conservatively, i.e., tend towards leaving the IW the 1165 same in the absence of sufficient information, and give greater 1166 consideration to IW segment loss than IW segment success. 1168 We expect that, without other context, a good IW algorithm will 1169 converge to a single value, but this is not required. An endpoint 1170 with additional context or information, or deployed in a constrained 1171 environment, can always use a different value. In specific, 1172 information from previous connections, or sets of connections with a 1173 similar path, can already be used as context for such decisions (as 1174 noted in the core of this document). 1176 However, if a given IW value persistently causes packet loss during 1177 the initial burst of packets, it is clearly inappropriate and could 1178 be inducing unnecessary loss in other competing connections. This 1179 might happen for sites behind very slow boxes with small buffers, 1180 which may or may not be the first hop. 1182 C.3. Proposed IW Algorithm 1184 Below is a simple description of the proposed IW algorithm. It 1185 relies on the following parameters: 1187 o MinIW = 3 MSS or 4,380 bytes (as per RFC3390] 1189 o MaxIW = 10 1191 o MulDecr = 0.5 1193 o AddIncr = 2 MSS 1195 o Threshold = 0.05 1196 We assume that the minimum IW (MinIW) should be as currently 1197 specified [RFC3390]. The maximum IW can be set to a fixed value 1198 [RFC6928], or set based on a schedule if trusted time references are 1199 available [Al10]; here we prefer a fixed value. We also propose to 1200 use an AIMD algorithm, with increase and decreases as noted. 1202 Although these parameters are somewhat arbitrary, their initial 1203 values are not important except that the algorithm is AIMD and the 1204 MaxIW should not exceed that recommended for other systems on the 1205 Internet. Current proposals, including default current operation, 1206 are degenerate cases of the algorithm below for given parameters - 1207 notably MulDec = 1.0 and AddIncr = 0 MSS, thus disabling the 1208 automatic part of the algorithm. 1210 The proposed algorithm is as follows: 1212 1. On boot: 1214 IW = MaxIW; # assume this is in bytes, and an even number of MSS 1216 2. Upon starting a new connection 1218 CWND = IW; 1219 conncount++; 1220 IWnotchecked = 1; # true 1222 3. During a connection's SYN-ACK processing, if SYN-ACK includes 1223 ECN, treat as if the IW is too large 1225 if (IWnotchecked && (synackecn == 1)) { 1226 losscount++; 1227 IWnotchecked = 0; # never check again 1228 } 1230 4. During a connection, if retransmission occurs, check the seqno of 1231 the outgoing packet (in bytes) to see if the resent segment fixes 1232 an IW loss: 1234 if (Retransmitting && IWnotchecked && ((ISN - seqno) < IW))) { 1235 losscount++; 1236 IWnotchecked = 0; # never do this entire "if" again 1237 } else { 1238 IWnotchecked = 0; # you're beyond the IW so stop checking 1239 } 1241 5. Once every 1000 conections, as a separate process (i.e., not as 1242 part of processing a given connection): 1244 if (conncount > 1000) { 1245 if (losscount/conncount > threshold) { 1246 # the number of connections with errors is too high 1247 IW = IW * MulDecr; 1248 } else { 1249 IW = IW + AddIncr; 1250 } 1251 } 1253 We recognize that this algorithm can yield a false positive when the 1254 sequence number wraps around. This can be avoided using either PAWS 1255 [RFC7323] context or 64-bit internal sequence numbers (as in TCP-AO 1256 [RFC5925]). Alternately, false positives can be allowed since they 1257 are expected to be infrequent and thus will not affect the overall 1258 statistics of the algorithm. 1260 The following additional constraints are imposed: 1262 >> The automatic IW algorithm MUST initialize to MaxIW, in the 1263 absence of other context information. 1265 If there are too few connections to make a decision or if there is 1266 otherwise insufficient information to increase the IW, then the 1267 MaxIW defaults to the current recommended value. 1269 >> An implementation may allow the MaxIW to grow beyond the 1270 currently recommended Internet default, but not more than 2 segments 1271 per calendar year. 1273 If an endpoint has a persistent history of successfully transmitting 1274 IW segments without loss, then it is allowed to probe the Internet 1275 to determine if larger IW values have similar success. This probing 1276 is limited and requires a trusted time source, otherwise the MaxIW 1277 remains constant. 1279 >> An implementation MUST adjust the IW based on loss statistics at 1280 least once every 1000 connections. 1282 An endpoint needs to be sufficiently reactive to IW loss. 1284 >> An implementation MUST decrease the IW by at least one MSS when 1285 indicated during an evaluation interval. 1287 An endpoint that detects loss needs to decrease its IW by at least 1288 one MSS, otherwise it is not participating in an automatic reactive 1289 algorithm. 1291 >> An implementation MUST increase by no more than 2 MSS per 1292 evaluation interval. 1294 An endpoint that does not experience IW loss needs to probe the 1295 network incrementally. 1297 >> An implementation SHOULD use an IW that is an integer multiple of 1298 2 MSS. 1300 The IW should remain a multiple of 2 MSS segments, to enable 1301 efficient ACK compression without incurring unnecessary timeouts. 1303 >> An implementation MUST decrease the IW if more than 95% of 1304 connections have IW losses. 1306 Again, this is to ensure an implementation is sufficiently reactive. 1308 >> An implementation MAY group IW values and statistics within 1309 subsets of connections. Such grouping MAY use any information about 1310 connections to form groups except loss statistics. 1312 There are some TCP connections which might not be counted at all, 1313 such as those to/from loopback addresses, or those within the same 1314 subnet as that of a local interface (for which congestion control is 1315 sometimes disabled anyway). This may also include connections that 1316 terminate before the IW is full, i.e., as a separate check at the 1317 time of the connection closing. 1319 The period over which the IW is updated is intended to be a long 1320 timescale, e.g., a month or so, or 1,000 connections, whichever is 1321 longer. An implementation might check the IW once a month, and 1322 simply not update the IW or clear the connection counts in months 1323 where the number of connections is too small. 1325 C.4. Discussion 1327 There are numerous parameters to the above algorithm that are 1328 compliant with the given requirements; this is intended to allow 1329 variation in configuration and implementation while ensuring that 1330 all such algorithms are reactive and safe. 1332 This algorithm continues to assume segments because that is the 1333 basis of most TCP implementations. It might be useful to consider 1334 revising the specifications to allow byte-based congestion given 1335 sufficient experience. 1337 The algorithm checks for IW losses only during the first IW after a 1338 connection start; it does not check for IW losses elsewhere the IW 1339 is used, e.g., during slow-start restarts. 1341 >> An implementation MAY detect IW losses during slow-start restarts 1342 in addition to losses during the first IW of a connection. In this 1343 case, the implementation MUST count each restart as a "connection" 1344 for the purposes of connection counts and periodic rechecking of the 1345 IW value. 1347 False positives can occur during some kinds of segment reordering, 1348 e.g., that might trigger spurious retransmissions even without a 1349 true segment loss. These are not expected to be sufficiently common 1350 to dominate the algorithm and its conclusions. 1352 This mechanism does require additional per-connection state which is 1353 currently common in some implementations, and is useful for other 1354 reasons (e.g., the ISN is used in TCP-AO [RFC5925]). The mechanism 1355 also benefits from persistent state kept across reboots, as would be 1356 other state sharing mechanisms (e.g., TCP Control Block Sharing 1357 [RFC2140]). The mechanism is inspired by RFC 2140's use of 1358 information across connections. 1360 The receive window (RWIN) is not involved in this calculation. The 1361 size of RWIN is determined by receiver resources, and provides space 1362 to accommodate segment reordering. It is not involved with 1363 congestion control, which is the focus of this document and its 1364 management of the IW. 1366 C.5. Observations 1368 The IW may not converge to a single, global value. It also may not 1369 converge at all, but rather may oscillate by a few MSS as it 1370 repeatedly probes the Internet for larger IWs and fails. Both 1371 properties are consistent with TCP behavior during each individual 1372 connection. 1374 This mechanism assumes that losses during the IW are due to IW size. 1375 Persistent errors that drop packets for other reasons - e.g., OS 1376 bugs, can cause false positives. Again, this is consistent with 1377 TCP's basic assumption that loss is caused by congestion and 1378 requires backoff. This algorithm treats the IW of new connections as 1379 a long-timescale backoff system.