idnits 2.17.1 draft-ietf-mptcp-rfc6824bis-10.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 : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([RFC6824]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. -- The draft header indicates that this document obsoletes RFC6824, but the abstract doesn't seem to directly say this. It does mention RFC6824 though, so this could be OK. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 4, 2018) is 2235 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'Data ACK' is mentioned on line 497, but not defined == Missing Reference: 'Checksum' is mentioned on line 498, but not defined == Missing Reference: 'Data FIN' is mentioned on line 526, but not defined == Missing Reference: 'DFIN' is mentioned on line 3535, but not defined ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Downref: Normative reference to an Informational RFC: RFC 6182 -- Possible downref: Non-RFC (?) normative reference: ref. 'SHS' -- Obsolete informational reference (is this intentional?): RFC 1323 (Obsoleted by RFC 7323) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 6528 (Obsoleted by RFC 9293) -- Obsolete informational reference (is this intentional?): RFC 6824 (Obsoleted by RFC 8684) Summary: 3 errors (**), 0 flaws (~~), 5 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force A. Ford 3 Internet-Draft Pexip 4 Obsoletes: 6824 (if approved) C. Raiciu 5 Intended status: Standards Track U. Politechnica of Bucharest 6 Expires: September 5, 2018 M. Handley 7 U. College London 8 O. Bonaventure 9 U. catholique de Louvain 10 C. Paasch 11 Apple, Inc. 12 March 4, 2018 14 TCP Extensions for Multipath Operation with Multiple Addresses 15 draft-ietf-mptcp-rfc6824bis-10 17 Abstract 19 TCP/IP communication is currently restricted to a single path per 20 connection, yet multiple paths often exist between peers. The 21 simultaneous use of these multiple paths for a TCP/IP session would 22 improve resource usage within the network and, thus, improve user 23 experience through higher throughput and improved resilience to 24 network failure. 26 Multipath TCP provides the ability to simultaneously use multiple 27 paths between peers. This document presents a set of extensions to 28 traditional TCP to support multipath operation. The protocol offers 29 the same type of service to applications as TCP (i.e., reliable 30 bytestream), and it provides the components necessary to establish 31 and use multiple TCP flows across potentially disjoint paths. 33 This document specifies v1 of Multipath TCP, obsoleting v0 as 34 specified in RFC6824 [RFC6824] through clarifications and 35 modifications primarily driven by deployment experience. 37 Status of This Memo 39 This Internet-Draft is submitted in full conformance with the 40 provisions of BCP 78 and BCP 79. 42 Internet-Drafts are working documents of the Internet Engineering 43 Task Force (IETF). Note that other groups may also distribute 44 working documents as Internet-Drafts. The list of current Internet- 45 Drafts is at https://datatracker.ietf.org/drafts/current/. 47 Internet-Drafts are draft documents valid for a maximum of six months 48 and may be updated, replaced, or obsoleted by other documents at any 49 time. It is inappropriate to use Internet-Drafts as reference 50 material or to cite them other than as "work in progress." 52 This Internet-Draft will expire on September 5, 2018. 54 Copyright Notice 56 Copyright (c) 2018 IETF Trust and the persons identified as the 57 document authors. All rights reserved. 59 This document is subject to BCP 78 and the IETF Trust's Legal 60 Provisions Relating to IETF Documents 61 (https://trustee.ietf.org/license-info) in effect on the date of 62 publication of this document. Please review these documents 63 carefully, as they describe your rights and restrictions with respect 64 to this document. Code Components extracted from this document must 65 include Simplified BSD License text as described in Section 4.e of 66 the Trust Legal Provisions and are provided without warranty as 67 described in the Simplified BSD License. 69 Table of Contents 71 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 72 1.1. Design Assumptions . . . . . . . . . . . . . . . . . . . 4 73 1.2. Multipath TCP in the Networking Stack . . . . . . . . . . 5 74 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 6 75 1.4. MPTCP Concept . . . . . . . . . . . . . . . . . . . . . . 7 76 1.5. Requirements Language . . . . . . . . . . . . . . . . . . 8 77 2. Operation Overview . . . . . . . . . . . . . . . . . . . . . 8 78 2.1. Initiating an MPTCP Connection . . . . . . . . . . . . . 9 79 2.2. Associating a New Subflow with an Existing MPTCP 80 Connection . . . . . . . . . . . . . . . . . . . . . . . 9 81 2.3. Informing the Other Host about Another Potential Address 10 82 2.4. Data Transfer Using MPTCP . . . . . . . . . . . . . . . . 11 83 2.5. Requesting a Change in a Path's Priority . . . . . . . . 11 84 2.6. Closing an MPTCP Connection . . . . . . . . . . . . . . . 12 85 2.7. Notable Features . . . . . . . . . . . . . . . . . . . . 12 86 3. MPTCP Protocol . . . . . . . . . . . . . . . . . . . . . . . 12 87 3.1. Connection Initiation . . . . . . . . . . . . . . . . . . 14 88 3.2. Starting a New Subflow . . . . . . . . . . . . . . . . . 20 89 3.3. General MPTCP Operation . . . . . . . . . . . . . . . . . 25 90 3.3.1. Data Sequence Mapping . . . . . . . . . . . . . . . . 27 91 3.3.2. Data Acknowledgments . . . . . . . . . . . . . . . . 30 92 3.3.3. Closing a Connection . . . . . . . . . . . . . . . . 31 93 3.3.4. Receiver Considerations . . . . . . . . . . . . . . . 32 94 3.3.5. Sender Considerations . . . . . . . . . . . . . . . . 33 95 3.3.6. Reliability and Retransmissions . . . . . . . . . . . 34 96 3.3.7. Congestion Control Considerations . . . . . . . . . . 35 97 3.3.8. Subflow Policy . . . . . . . . . . . . . . . . . . . 36 98 3.4. Address Knowledge Exchange (Path Management) . . . . . . 37 99 3.4.1. Address Advertisement . . . . . . . . . . . . . . . . 38 100 3.4.2. Remove Address . . . . . . . . . . . . . . . . . . . 42 101 3.5. Fast Close . . . . . . . . . . . . . . . . . . . . . . . 43 102 3.6. Subflow Reset . . . . . . . . . . . . . . . . . . . . . . 44 103 3.7. MPTCP Experimental Option . . . . . . . . . . . . . . . . 46 104 3.8. Fallback . . . . . . . . . . . . . . . . . . . . . . . . 47 105 3.9. Error Handling . . . . . . . . . . . . . . . . . . . . . 51 106 3.10. Heuristics . . . . . . . . . . . . . . . . . . . . . . . 52 107 3.10.1. Port Usage . . . . . . . . . . . . . . . . . . . . . 52 108 3.10.2. Delayed Subflow Start and Subflow Symmetry . . . . . 52 109 3.10.3. Failure Handling . . . . . . . . . . . . . . . . . . 53 110 3.11. TCP Fast Open . . . . . . . . . . . . . . . . . . . . . . 54 111 3.11.1. TFO cookie request with MPTCP . . . . . . . . . . . 54 112 3.11.2. Data sequence mapping under TFO . . . . . . . . . . 55 113 3.11.3. Connection establishment examples . . . . . . . . . 56 114 4. Semantic Issues . . . . . . . . . . . . . . . . . . . . . . . 58 115 5. Security Considerations . . . . . . . . . . . . . . . . . . . 59 116 6. Interactions with Middleboxes . . . . . . . . . . . . . . . . 62 117 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 65 118 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 65 119 8.1. MPTCP Option Subtypes . . . . . . . . . . . . . . . . . . 66 120 8.2. MPTCP Handshake Algorithms . . . . . . . . . . . . . . . 67 121 8.3. MP_TCPRST Reason Codes . . . . . . . . . . . . . . . . . 67 122 8.4. Experimental option registry . . . . . . . . . . . . . . 68 123 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 68 124 9.1. Normative References . . . . . . . . . . . . . . . . . . 68 125 9.2. Informative References . . . . . . . . . . . . . . . . . 69 126 Appendix A. Notes on Use of TCP Options . . . . . . . . . . . . 72 127 Appendix B. Control Blocks . . . . . . . . . . . . . . . . . . . 73 128 B.1. MPTCP Control Block . . . . . . . . . . . . . . . . . . . 74 129 B.1.1. Authentication and Metadata . . . . . . . . . . . . . 74 130 B.1.2. Sending Side . . . . . . . . . . . . . . . . . . . . 74 131 B.1.3. Receiving Side . . . . . . . . . . . . . . . . . . . 74 132 B.2. TCP Control Blocks . . . . . . . . . . . . . . . . . . . 75 133 B.2.1. Sending Side . . . . . . . . . . . . . . . . . . . . 75 134 B.2.2. Receiving Side . . . . . . . . . . . . . . . . . . . 75 135 Appendix C. Finite State Machine . . . . . . . . . . . . . . . . 75 136 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 76 138 1. Introduction 140 Multipath TCP (MPTCP) is a set of extensions to regular TCP [RFC0793] 141 to provide a Multipath TCP [RFC6182] service, which enables a 142 transport connection to operate across multiple paths simultaneously. 143 This document presents the protocol changes required to add multipath 144 capability to TCP; specifically, those for signaling and setting up 145 multiple paths ("subflows"), managing these subflows, reassembly of 146 data, and termination of sessions. This is not the only information 147 required to create a Multipath TCP implementation, however. This 148 document is complemented by three others: 150 o Architecture [RFC6182], which explains the motivations behind 151 Multipath TCP, contains a discussion of high-level design 152 decisions on which this design is based, and an explanation of a 153 functional separation through which an extensible MPTCP 154 implementation can be developed. 156 o Congestion control [RFC6356] presents a safe congestion control 157 algorithm for coupling the behavior of the multiple paths in order 158 to "do no harm" to other network users. 160 o Application considerations [RFC6897] discusses what impact MPTCP 161 will have on applications, what applications will want to do with 162 MPTCP, and as a consequence of these factors, what API extensions 163 an MPTCP implementation should present. 165 This document is an update to, and obsoletes, the v0 specification of 166 Multipath TCP [RFC6824]. This document specifies MPTCP v1, which is 167 not backward compatible with MPTCP v0. This document additionally 168 defines version negotiation procedures for implementations that 169 support both versions. 171 1.1. Design Assumptions 173 In order to limit the potentially huge design space, the working 174 group imposed two key constraints on the Multipath TCP design 175 presented in this document: 177 o It must be backwards-compatible with current, regular TCP, to 178 increase its chances of deployment. 180 o It can be assumed that one or both hosts are multihomed and 181 multiaddressed. 183 To simplify the design, we assume that the presence of multiple 184 addresses at a host is sufficient to indicate the existence of 185 multiple paths. These paths need not be entirely disjoint: they may 186 share one or many routers between them. Even in such a situation, 187 making use of multiple paths is beneficial, improving resource 188 utilization and resilience to a subset of node failures. The 189 congestion control algorithms defined in [RFC6356] ensure this does 190 not act detrimentally. Furthermore, there may be some scenarios 191 where different TCP ports on a single host can provide disjoint paths 192 (such as through certain Equal-Cost Multipath (ECMP) implementations 194 [RFC2992]), and so the MPTCP design also supports the use of ports in 195 path identifiers. 197 There are three aspects to the backwards-compatibility listed above 198 (discussed in more detail in [RFC6182]): 200 External Constraints: The protocol must function through the vast 201 majority of existing middleboxes such as NATs, firewalls, and 202 proxies, and as such must resemble existing TCP as far as possible 203 on the wire. Furthermore, the protocol must not assume the 204 segments it sends on the wire arrive unmodified at the 205 destination: they may be split or coalesced; TCP options may be 206 removed or duplicated. 208 Application Constraints: The protocol must be usable with no change 209 to existing applications that use the common TCP API (although it 210 is reasonable that not all features would be available to such 211 legacy applications). Furthermore, the protocol must provide the 212 same service model as regular TCP to the application. 214 Fallback: The protocol should be able to fall back to standard TCP 215 with no interference from the user, to be able to communicate with 216 legacy hosts. 218 The complementary application considerations document [RFC6897] 219 discusses the necessary features of an API to provide backwards- 220 compatibility, as well as API extensions to convey the behavior of 221 MPTCP at a level of control and information equivalent to that 222 available with regular, single-path TCP. 224 Further discussion of the design constraints and associated design 225 decisions are given in the MPTCP Architecture document [RFC6182] and 226 in [howhard]. 228 1.2. Multipath TCP in the Networking Stack 230 MPTCP operates at the transport layer and aims to be transparent to 231 both higher and lower layers. It is a set of additional features on 232 top of standard TCP; Figure 1 illustrates this layering. MPTCP is 233 designed to be usable by legacy applications with no changes; 234 detailed discussion of its interactions with applications is given in 235 [RFC6897]. 237 +-------------------------------+ 238 | Application | 239 +---------------+ +-------------------------------+ 240 | Application | | MPTCP | 241 +---------------+ + - - - - - - - + - - - - - - - + 242 | TCP | | Subflow (TCP) | Subflow (TCP) | 243 +---------------+ +-------------------------------+ 244 | IP | | IP | IP | 245 +---------------+ +-------------------------------+ 247 Figure 1: Comparison of Standard TCP and MPTCP Protocol Stacks 249 1.3. Terminology 251 This document makes use of a number of terms that are either MPTCP- 252 specific or have defined meaning in the context of MPTCP, as follows: 254 Path: A sequence of links between a sender and a receiver, defined 255 in this context by a 4-tuple of source and destination address/ 256 port pairs. 258 Subflow: A flow of TCP segments operating over an individual path, 259 which forms part of a larger MPTCP connection. A subflow is 260 started and terminated similar to a regular TCP connection. 262 (MPTCP) Connection: A set of one or more subflows, over which an 263 application can communicate between two hosts. There is a one-to- 264 one mapping between a connection and an application socket. 266 Data-level: The payload data is nominally transferred over a 267 connection, which in turn is transported over subflows. Thus, the 268 term "data-level" is synonymous with "connection level", in 269 contrast to "subflow-level", which refers to properties of an 270 individual subflow. 272 Token: A locally unique identifier given to a multipath connection 273 by a host. May also be referred to as a "Connection ID". 275 Host: An end host operating an MPTCP implementation, and either 276 initiating or accepting an MPTCP connection. 278 In addition to these terms, note that MPTCP's interpretation of, and 279 effect on, regular single-path TCP semantics are discussed in 280 Section 4. 282 1.4. MPTCP Concept 284 This section provides a high-level summary of normal operation of 285 MPTCP, and is illustrated by the scenario shown in Figure 2. A 286 detailed description of operation is given in Section 3. 288 o To a non-MPTCP-aware application, MPTCP will behave the same as 289 normal TCP. Extended APIs could provide additional control to 290 MPTCP-aware applications [RFC6897]. An application begins by 291 opening a TCP socket in the normal way. MPTCP signaling and 292 operation are handled by the MPTCP implementation. 294 o An MPTCP connection begins similarly to a regular TCP connection. 295 This is illustrated in Figure 2 where an MPTCP connection is 296 established between addresses A1 and B1 on Hosts A and B, 297 respectively. 299 o If extra paths are available, additional TCP sessions (termed 300 MPTCP "subflows") are created on these paths, and are combined 301 with the existing session, which continues to appear as a single 302 connection to the applications at both ends. The creation of the 303 additional TCP session is illustrated between Address A2 on Host A 304 and Address B1 on Host B. 306 o MPTCP identifies multiple paths by the presence of multiple 307 addresses at hosts. Combinations of these multiple addresses 308 equate to the additional paths. In the example, other potential 309 paths that could be set up are A1<->B2 and A2<->B2. Although this 310 additional session is shown as being initiated from A2, it could 311 equally have been initiated from B1. 313 o The discovery and setup of additional subflows will be achieved 314 through a path management method; this document describes a 315 mechanism by which a host can initiate new subflows by using its 316 own additional addresses, or by signaling its available addresses 317 to the other host. 319 o MPTCP adds connection-level sequence numbers to allow the 320 reassembly of segments arriving on multiple subflows with 321 differing network delays. 323 o Subflows are terminated as regular TCP connections, with a four- 324 way FIN handshake. The MPTCP connection is terminated by a 325 connection-level FIN. 327 Host A Host B 328 ------------------------ ------------------------ 329 Address A1 Address A2 Address B1 Address B2 330 ---------- ---------- ---------- ---------- 331 | | | | 332 | (initial connection setup) | | 333 |----------------------------------->| | 334 |<-----------------------------------| | 335 | | | | 336 | (additional subflow setup) | 337 | |--------------------->| | 338 | |<---------------------| | 339 | | | | 340 | | | | 342 Figure 2: Example MPTCP Usage Scenario 344 1.5. Requirements Language 346 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 347 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 348 document are to be interpreted as described in RFC 2119 [RFC2119]. 350 2. Operation Overview 352 This section presents a single description of common MPTCP operation, 353 with reference to the protocol operation. This is a high-level 354 overview of the key functions; the full specification follows in 355 Section 3. Extensibility and negotiated features are not discussed 356 here. Considerable reference is made to symbolic names of MPTCP 357 options throughout this section -- these are subtypes of the IANA- 358 assigned MPTCP option (see Section 8), and their formats are defined 359 in the detailed protocol specification that follows in Section 3. 361 A Multipath TCP connection provides a bidirectional bytestream 362 between two hosts communicating like normal TCP and, thus, does not 363 require any change to the applications. However, Multipath TCP 364 enables the hosts to use different paths with different IP addresses 365 to exchange packets belonging to the MPTCP connection. A Multipath 366 TCP connection appears like a normal TCP connection to an 367 application. However, to the network layer, each MPTCP subflow looks 368 like a regular TCP flow whose segments carry a new TCP option type. 369 Multipath TCP manages the creation, removal, and utilization of these 370 subflows to send data. The number of subflows that are managed 371 within a Multipath TCP connection is not fixed and it can fluctuate 372 during the lifetime of the Multipath TCP connection. 374 All MPTCP operations are signaled with a TCP option -- a single 375 numerical type for MPTCP, with "sub-types" for each MPTCP message. 376 What follows is a summary of the purpose and rationale of these 377 messages. 379 2.1. Initiating an MPTCP Connection 381 This is the same signaling as for initiating a normal TCP connection, 382 but the SYN, SYN/ACK, and initial ACK packets also carry the 383 MP_CAPABLE option. This option is variable length and serves 384 multiple purposes. Firstly, it verifies whether the remote host 385 supports Multipath TCP; secondly, this option allows the hosts to 386 exchange some information to authenticate the establishment of 387 additional subflows. Further details are given in Section 3.1. 389 Host A Host B 390 ------ ------ 391 MP_CAPABLE -> 392 [flags] 393 <- MP_CAPABLE 394 [B's key, flags] 395 ACK + MP_CAPABLE (+ data) -> 396 [A's key, B's key, flags, (data-level details)] 398 2.2. Associating a New Subflow with an Existing MPTCP Connection 400 The exchange of keys in the MP_CAPABLE handshake provides material 401 that can be used to authenticate the endpoints when new subflows will 402 be set up. Additional subflows begin in the same way as initiating a 403 normal TCP connection, but the SYN, SYN/ACK, and ACK packets also 404 carry the MP_JOIN option. 406 Host A initiates a new subflow between one of its addresses and one 407 of Host B's addresses. The token -- generated from the key -- is 408 used to identify which MPTCP connection it is joining, and the HMAC 409 is used for authentication. The Hash-based Message Authentication 410 Code (HMAC) uses the keys exchanged in the MP_CAPABLE handshake, and 411 the random numbers (nonces) exchanged in these MP_JOIN options. 412 MP_JOIN also contains flags and an Address ID that can be used to 413 refer to the source address without the sender needing to know if it 414 has been changed by a NAT. Further details are in Section 3.2. 416 Host A Host B 417 ------ ------ 418 MP_JOIN -> 419 [B's token, A's nonce, 420 A's Address ID, flags] 421 <- MP_JOIN 422 [B's HMAC, B's nonce, 423 B's Address ID, flags] 424 ACK + MP_JOIN -> 425 [A's HMAC] 427 <- ACK 429 2.3. Informing the Other Host about Another Potential Address 431 The set of IP addresses associated to a multihomed host may change 432 during the lifetime of an MPTCP connection. MPTCP supports the 433 addition and removal of addresses on a host both implicitly and 434 explicitly. If Host A has established a subflow starting at address/ 435 port pair IP#-A1 and wants to open a second subflow starting at 436 address/port pair IP#-A2, it simply initiates the establishment of 437 the subflow as explained above. The remote host will then be 438 implicitly informed about the new address. 440 In some circumstances, a host may want to advertise to the remote 441 host the availability of an address without establishing a new 442 subflow, for example, when a NAT prevents setup in one direction. In 443 the example below, Host A informs Host B about its alternative IP 444 address/port pair (IP#-A2). Host B may later send an MP_JOIN to this 445 new address. This option contains a HMAC to authenticate the address 446 as having been sent from the originator of the connection. Further 447 details are in Section 3.4.1. 449 Host A Host B 450 ------ ------ 451 ADD_ADDR -> 452 [IP#-A2, 453 IP#-A2's Address ID, 454 HMAC of IP#-A2] 456 There is a corresponding signal for address removal, making use of 457 the Address ID that is signaled in the add address handshake. 458 Further details in Section 3.4.2. 460 Host A Host B 461 ------ ------ 462 REMOVE_ADDR -> 463 [IP#-A2's Address ID] 465 2.4. Data Transfer Using MPTCP 467 To ensure reliable, in-order delivery of data over subflows that may 468 appear and disappear at any time, MPTCP uses a 64-bit data sequence 469 number (DSN) to number all data sent over the MPTCP connection. Each 470 subflow has its own 32-bit sequence number space, utilising the 471 regular TCP sequence number header, and an MPTCP option maps the 472 subflow sequence space to the data sequence space. In this way, data 473 can be retransmitted on different subflows (mapped to the same DSN) 474 in the event of failure. 476 The "Data Sequence Signal" carries the "Data Sequence Mapping". The 477 data sequence mapping consists of the subflow sequence number, data 478 sequence number, and length for which this mapping is valid. This 479 option can also carry a connection-level acknowledgment (the "Data 480 ACK") for the received DSN. 482 With MPTCP, all subflows share the same receive buffer and advertise 483 the same receive window. There are two levels of acknowledgment in 484 MPTCP. Regular TCP acknowledgments are used on each subflow to 485 acknowledge the reception of the segments sent over the subflow 486 independently of their DSN. In addition, there are connection-level 487 acknowledgments for the data sequence space. These acknowledgments 488 track the advancement of the bytestream and slide the receiving 489 window. 491 Further details are in Section 3.3. 493 Host A Host B 494 ------ ------ 495 DATA_SEQUENCE_SIGNAL -> 496 [Data Sequence Mapping] 497 [Data ACK] 498 [Checksum] 500 2.5. Requesting a Change in a Path's Priority 502 Hosts can indicate at initial subflow setup whether they wish the 503 subflow to be used as a regular or backup path -- a backup path only 504 being used if there are no regular paths available. During a 505 connection, Host A can request a change in the priority of a subflow 506 through the MP_PRIO signal to Host B. Further details are in 507 Section 3.3.8. 509 Host A Host B 510 ------ ------ 511 MP_PRIO -> 513 2.6. Closing an MPTCP Connection 515 When Host A wants to inform Host B that it has no more data to send, 516 it signals this "Data FIN" as part of the Data Sequence Signal (see 517 above). It has the same semantics and behavior as a regular TCP FIN, 518 but at the connection level. Once all the data on the MPTCP 519 connection has been successfully received, then this message is 520 acknowledged at the connection level with a DATA_ACK. Further 521 details are in Section 3.3.3. 523 Host A Host B 524 ------ ------ 525 DATA_SEQUENCE_SIGNAL -> 526 [Data FIN] 528 <- (MPTCP DATA_ACK) 530 2.7. Notable Features 532 It is worth highlighting that MPTCP's signaling has been designed 533 with several key requirements in mind: 535 o To cope with NATs on the path, addresses are referred to by 536 Address IDs, in case the IP packet's source address gets changed 537 by a NAT. Setting up a new TCP flow is not possible if the 538 passive opener is behind a NAT; to allow subflows to be created 539 when either end is behind a NAT, MPTCP uses the ADD_ADDR message. 541 o MPTCP falls back to ordinary TCP if MPTCP operation is not 542 possible, for example, if one host is not MPTCP capable or if a 543 middlebox alters the payload. 545 o To meet the threats identified in [RFC6181], the following steps 546 are taken: keys are sent in the clear in the MP_CAPABLE messages; 547 MP_JOIN messages are secured with HMAC-SHA256 ([RFC2104], [SHS]) 548 using those keys; and standard TCP validity checks are made on the 549 other messages (ensuring sequence numbers are in-window 550 [RFC5961]). 552 3. MPTCP Protocol 554 This section describes the operation of the MPTCP protocol, and is 555 subdivided into sections for each key part of the protocol operation. 557 All MPTCP operations are signaled using optional TCP header fields. 558 A single TCP option number ("Kind") has been assigned by IANA for 559 MPTCP (see Section 8), and then individual messages will be 560 determined by a "subtype", the values of which are also stored in an 561 IANA registry (and are also listed in Section 8). 563 Throughout this document, when reference is made to an MPTCP option 564 by symbolic name, such as "MP_CAPABLE", this refers to a TCP option 565 with the single MPTCP option type, and with the subtype value of the 566 symbolic name as defined in Section 8. This subtype is a 4-bit field 567 -- the first 4 bits of the option payload, as shown in Figure 3. The 568 MPTCP messages are defined in the following sections. 570 1 2 3 571 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 572 +---------------+---------------+-------+-----------------------+ 573 | Kind | Length |Subtype| | 574 +---------------+---------------+-------+ | 575 | Subtype-specific data | 576 | (variable length) | 577 +---------------------------------------------------------------+ 579 Figure 3: MPTCP Option Format 581 Those MPTCP options associated with subflow initiation are used on 582 packets with the SYN flag set. Additionally, there is one MPTCP 583 option for signaling metadata to ensure segmented data can be 584 recombined for delivery to the application. 586 The remaining options, however, are signals that do not need to be on 587 a specific packet, such as those for signaling additional addresses. 588 Whilst an implementation may desire to send MPTCP options as soon as 589 possible, it may not be possible to combine all desired options (both 590 those for MPTCP and for regular TCP, such as SACK (selective 591 acknowledgment) [RFC2018]) on a single packet. Therefore, an 592 implementation may choose to send duplicate ACKs containing the 593 additional signaling information. This changes the semantics of a 594 duplicate ACK; these are usually only sent as a signal of a lost 595 segment [RFC5681] in regular TCP. Therefore, an MPTCP implementation 596 receiving a duplicate ACK that contains an MPTCP option MUST NOT 597 treat it as a signal of congestion. Additionally, an MPTCP 598 implementation SHOULD NOT send more than two duplicate ACKs in a row 599 for the purposes of sending MPTCP options alone, in order to ensure 600 no middleboxes misinterpret this as a sign of congestion. 602 Furthermore, standard TCP validity checks (such as ensuring the 603 sequence number and acknowledgment number are within window) MUST be 604 undertaken before processing any MPTCP signals, as described in 605 [RFC5961], and initial subfow sequence numbers SHOULD be generated 606 according to the recommendations in [RFC6528]. 608 3.1. Connection Initiation 610 Connection initiation begins with a SYN, SYN/ACK, ACK exchange on a 611 single path. Each packet contains the Multipath Capable (MP_CAPABLE) 612 MPTCP option (Figure 4). This option declares its sender is capable 613 of performing Multipath TCP and wishes to do so on this particular 614 connection. 616 The MP_CAPABLE exchange in this specification (v1) is different to 617 that specified in v0 [RFC6824]. If a host supports multiple versions 618 of MPTCP, the sender of the MP_CAPABLE option SHOULD signal the 619 highest version number it supports. The passive opener, on receipt 620 of this, will signal the version number it wishes to use, which MUST 621 be equal to or lower than the version number indicated in the initial 622 MP_CAPABLE. Given the SYN exchange is different between v1 and v0 623 the exchange cannot be immediately downgraded, and therefore if the 624 far end has requested a lower version then the initiator SHOULD 625 respond with an ACK without any MP_CAPABLE option, to fall back to 626 regular TCP. If the initiator supports the requsted version, on 627 future connections to the target host, the initiator MAY cache the 628 version preference. Alternatively, the initiator MAY close the 629 connection with a TCP RST and immediately re-establish with the 630 requested version of MPTCP. 632 The MP_CAPABLE option is variable-length, with different fields 633 included depending on which packet the option is used on. The full 634 MP_CAPABLE option is shown in Figure 4. 636 1 2 3 637 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 638 +---------------+---------------+-------+-------+---------------+ 639 | Kind | Length |Subtype|Version|A|B|C|D|E|F|G|H| 640 +---------------+---------------+-------+-------+---------------+ 641 | Option Sender's Key (64 bits) | 642 | (if option Length > 4) | 643 | | 644 +---------------------------------------------------------------+ 645 | Option Receiver's Key (64 bits) | 646 | (if option Length > 12) | 647 | | 648 +-------------------------------+-------------------------------+ 649 | Data-Level Length (16 bits) | Checksum (16 bits, optional) | 650 +-------------------------------+-------------------------------+ 652 Figure 4: Multipath Capable (MP_CAPABLE) Option 654 The MP_CAPABLE option is carried on the SYN, SYN/ACK, and ACK packets 655 that start the first subflow of an MPTCP connection, as well as the 656 first packet that carries data, if the initiator wishs to send first. 657 The data carried by each option is as follows, where A = initiator 658 and B = listener. 660 o SYN (A->B): only the first four octets (Length = 4). 662 o SYN/ACK (B->A): B's Key for this connection (Length = 12). 664 o ACK (no data) (A->B): A's Key followed by B's Key (Length = 20). 666 o ACK (with first data) (A->B): A's Key followed by B's Key followed 667 by Data-Level Length, and optional Checksum (Length = 22 or 24). 669 The contents of the option is determined by the SYN and ACK flags of 670 the packet, along with the option's length field. For the diagram 671 shown in Figure 4, "sender" and "receiver" refer to the sender or 672 receiver of the TCP packet (which can be either host). 674 The initial SYN, containing just the MP_CAPABLE header, is used to 675 define the version of MPTCP being requested, as well as exchanging 676 flags to negotiate connection features, described later. 678 This option is used to declare the 64-bit keys that the end hosts 679 have generated for this MPTCP connection. This key is used to 680 authenticate the addition of future subflows to this connection. 681 This is the only time the key will be sent in clear on the wire 682 (unless "fast close", Section 3.5, is used); all future subflows will 683 identify the connection using a 32-bit "token". This token is a 684 cryptographic hash of this key. The algorithm for this process is 685 dependent on the authentication algorithm selected; the method of 686 selection is defined later in this section. 688 Upon reception of the initial SYN-segment, a stateful server 689 generates a random key and replies with a SYN/ACK. The key's method 690 of generation is implementation specific. The key MUST be hard to 691 guess, and it MUST be unique for the sending host at any one time. 692 Recommendations for generating random numbers for use in keys are 693 given in [RFC4086]. Connections will be indexed at each host by the 694 token (a one-way hash of the key). Therefore, an implementation will 695 require a mapping from each token to the corresponding connection, 696 and in turn to the keys for the connection. 698 There is a risk that two different keys will hash to the same token. 699 The risk of hash collisions is usually small, unless the host is 700 handling many tens of thousands of connections. Therefore, an 701 implementation SHOULD check its list of connection tokens to ensure 702 there is not a collision before sending its key, and if there is, 703 then it should generate a new key. This would, however, be costly 704 for a server with thousands of connections. The subflow handshake 705 mechanism (Section 3.2) will ensure that new subflows only join the 706 correct connection, however, through the cryptographic handshake, as 707 well as checking the connection tokens in both directions, and 708 ensuring sequence numbers are in-window. So in the worst case if 709 there was a token collision, the new subflow would not succeed, but 710 the MPTCP connection would continue to provide a regular TCP service. 712 Since key generation is implementation-specific, there is no 713 requirement that they be simply random numbers. An implemention is 714 free to exchange cryptographic material out-of-band and generate 715 these keys from this, in order to provide additional mechanisms by 716 which to verify the identity of the communicating entities. For 717 example, an implementation could choose to link its MPTCP keys to 718 those used in higher-layer TLS or SSH connections. 720 If the server behaves in a stateless manner, it has to generate its 721 own key in a verifiable fashion. This verifiable way of generating 722 the key can be done by using a hash of the 4-tuple, sequence number 723 and a local secret (similar to what is done for the TCP-sequence 724 number [RFC4987]). It will thus be able to verify whether it is 725 indeed the originator of the key echoed back in the later MP_CAPABLE 726 option. As for a stateful server, the tokens SHOULD be checked for 727 uniqueness, however if uniqueness is not met, and there is no way to 728 generate an alternative verifiable key, then the connection MUST fall 729 back to using regular TCP by not sending a MP_CAPABLE in the SYN/ACK. 731 The ACK carries both A's key and B's key. This is the first time 732 that A's key is seen on the wire, although it is expected that A will 733 have generated a key locally before the initial SYN. The echoing of 734 B's key allows B to operate statelessly, as described above. 735 Therefore, A's key must be delivered reliably to B, and in order to 736 do this, the transmission of this packet must be made reliable. 738 If B has data to send first, then the reliable delivery of the ACK 739 can be inferred by the receipt of this data with a MPTCP Data 740 Sequence Signal (DSS) option (Section 3.3). If, however, A wishes to 741 send data first, it would not know whether the ACK has successfully 742 been received, and thus whether the MPTCP is successfully 743 established. Therefore, on the first data A has to send (if it has 744 not received any data from B), it MUST also include a MP_CAPABLE 745 option, with additional data parameters (the Data-Level Length and 746 optional Checksum as shown in Figure 4). This packet may be the 747 third ACK if data is ready to be sent by the application, or may be a 748 later packet if the application only later has data to send. This 749 MP_CAPABLE option is in place of the DSS, and simply specifies the 750 data-level length of the payload, and the checksum (if the use of 751 checksums is negotiated). This is the minimal data required to 752 establish a MPTCP connection - it allows validation of the payload, 753 and given it is the first data, the Initial Data Sequence Number 754 (IDSN) is also known (as it is generated from the key, as described 755 below). Conveying the keys on the first data packet allows the TCP 756 reliability mechanisms to ensure the packet is successfully 757 delivered. The receiver will acknowledge this data a the connection 758 level with a Data ACK, as if a DSS option has been received. 760 There could be situations where both A and B attempt to transmit 761 initial data at the same time. For example, if A did not initially 762 have data to send, but then needed to transmit data before it had 763 received anything from B, it would use a MP_CAPABLE option with data 764 parameters (since it would not know if the MP_CAPABLE on the ACK was 765 received). In such a situation, B may also have transmitted data 766 with a DSS option, but it had not yet been received at A. Therefore, 767 B has received data with a MP_CAPABLE mapping after it has sent data 768 with a DSS option. To ensure these situations can be handled, it 769 follows that the data parameters in a MP_CAPABLE are semantically 770 equivalent to those in a DSS option and can be used interchangeably. 771 Similar situations could occur when the MP_CAPABLE with data is lost 772 and retransmitted. Furthermore, in the case of TCP Segmentation 773 Offloading, the MP_CAPABLE with data parameters may be duplicated 774 across multiple packets, and implementations must also be able to 775 cope with duplicate MP_CAPABLE mappings as well as duplicate DSS 776 mappings. 778 Additionally, the MP_CAPABLE exchange allows the safe passage of 779 MPTCP options on SYN packets to be determined. If any of these 780 options are dropped, MPTCP will gracefully fall back to regular 781 single-path TCP, as documented in Section 3.8. Note that new 782 subflows MUST NOT be established (using the process documented in 783 Section 3.2) until a Data Sequence Signal (DSS) option has been 784 successfully received across the path (as documented in Section 3.3). 786 The first 4 bits of the first octet in the MP_CAPABLE option 787 (Figure 4) define the MPTCP option subtype (see Section 8; for 788 MP_CAPABLE, this is 0), and the remaining 4 bits of this octet 789 specify the MPTCP version in use (for this specification, this is 1). 791 The second octet is reserved for flags, allocated as follows: 793 A: The leftmost bit, labeled "A", SHOULD be set to 1 to indicate 794 "Checksum Required", unless the system administrator has decided 795 that checksums are not required (for example, if the environment 796 is controlled and no middleboxes exist that might adjust the 797 payload). 799 B: The second bit, labeled "B", is an extensibility flag, and MUST be 800 set to 0 for current implementations. This will be used for an 801 extensibility mechanism in a future specification, and the impact 802 of this flag will be defined at a later date. If receiving a 803 message with the 'B' flag set to 1, and this is not understood, 804 then this SYN MUST be silently ignored; the sender is expected to 805 retry with a format compatible with this legacy specification. 806 Note that the length of the MP_CAPABLE option, and the meanings of 807 bits "C" through "H", may be altered by setting B=1. 809 C: The third bit, labeled "C", is set to "1" to indicate that the 810 sender of this option will not accept additional MPTCP subflows to 811 the source address and port, and therefore the receiver MUST NOT 812 try to open any additional subflows towards this address and port. 813 This is an efficiency improvement for situations where the sender 814 knows a restriction is in place, for example if the sender is 815 behind a strict NAT, or operating behind a legacy Layer 4 load 816 balancer. 818 D through H: The remaining bits, labeled "D" through "H", are used 819 for crypto algorithm negotiation. Currently only the rightmost 820 bit, labeled "H", is assigned. Bit "H" indicates the use of HMAC- 821 SHA256 (as defined in Section 3.2). An implementation that only 822 supports this method MUST set bit "H" to 1, and bits "D" through 823 "G" to 0. 825 A crypto algorithm MUST be specified. If flag bits D through H are 826 all 0, the MP_CAPABLE option MUST be treated as invalid and ignored 827 (that is, it must be treated as a regular TCP handshake). 829 The selection of the authentication algorithm also impacts the 830 algorithm used to generate the token and the Initial Data Sequence 831 Number (IDSN). In this specification, with only the SHA-256 832 algorithm (bit "H") specified and selected, the token MUST be a 833 truncated (most significant 32 bits) SHA-256 hash ([SHS], [RFC6234]) 834 of the key. A different, 64-bit truncation (the least significant 64 835 bits) of the SHA-256 hash of the key MUST be used as the IDSN. Note 836 that the key MUST be hashed in network byte order. Also note that 837 the "least significant" bits MUST be the rightmost bits of the 838 SHA-256 digest, as per [SHS]. Future specifications of the use of 839 the crypto bits may choose to specify different algorithms for token 840 and IDSN generation. 842 Both the crypto and checksum bits negotiate capabilities in similar 843 ways. For the Checksum Required bit (labeled "A"), if either host 844 requires the use of checksums, checksums MUST be used. In other 845 words, the only way for checksums not to be used is if both hosts in 846 their SYNs set A=0. This decision is confirmed by the setting of the 847 "A" bit in the third packet (the ACK) of the handshake. For example, 848 if the initiator sets A=0 in the SYN, but the responder sets A=1 in 849 the SYN/ACK, checksums MUST be used in both directions, and the 850 initiator will set A=1 in the ACK. The decision whether to use 851 checksums will be stored by an implementation in a per-connection 852 binary state variable. If A=1 is received by a host that does not 853 want to use checksums, it MUST fall back to regular TCP by ignoring 854 the MP_CAPABLE option as if it was invalid. 856 For crypto negotiation, the responder has the choice. The initiator 857 creates a proposal setting a bit for each algorithm it supports to 1 858 (in this version of the specification, there is only one proposal, so 859 bit "H" will be always set to 1). The responder responds with only 1 860 bit set -- this is the chosen algorithm. The rationale for this 861 behavior is that the responder will typically be a server with 862 potentially many thousands of connections, so it may wish to choose 863 an algorithm with minimal computational complexity, depending on the 864 load. If a responder does not support (or does not want to support) 865 any of the initiator's proposals, it can respond without an 866 MP_CAPABLE option, thus forcing a fallback to regular TCP. 868 The MP_CAPABLE option is only used in the first subflow of a 869 connection, in order to identify the connection; all following 870 subflows will use the "Join" option (see Section 3.2) to join the 871 existing connection. 873 If a SYN contains an MP_CAPABLE option but the SYN/ACK does not, it 874 is assumed that the passive opener is not multipath capable; thus, 875 the MPTCP session MUST operate as a regular, single-path TCP. If a 876 SYN does not contain a MP_CAPABLE option, the SYN/ACK MUST NOT 877 contain one in response. If the third packet (the ACK) does not 878 contain the MP_CAPABLE option, then the session MUST fall back to 879 operating as a regular, single-path TCP. This is to maintain 880 compatibility with middleboxes on the path that drop some or all TCP 881 options. Note that an implementation MAY choose to attempt sending 882 MPTCP options more than one time before making this decision to 883 operate as regular TCP (see Section 3.10). 885 If the SYN packets are unacknowledged, it is up to local policy to 886 decide how to respond. It is expected that a sender will eventually 887 fall back to single-path TCP (i.e., without the MP_CAPABLE option) in 888 order to work around middleboxes that may drop packets with unknown 889 options; however, the number of multipath-capable attempts that are 890 made first will be up to local policy. It is possible that MPTCP and 891 non-MPTCP SYNs could get reordered in the network. Therefore, the 892 final state is inferred from the presence or absence of the 893 MP_CAPABLE option in the third packet of the TCP handshake. If this 894 option is not present, the connection SHOULD fall back to regular 895 TCP, as documented in Section 3.8. 897 The initial data sequence number on an MPTCP connection is generated 898 from the key. The algorithm for IDSN generation is also determined 899 from the negotiated authentication algorithm. In this specification, 900 with only the SHA-256 algorithm specified and selected, the IDSN of a 901 host MUST be the least significant 64 bits of the SHA-256 hash of its 902 key, i.e., IDSN-A = Hash(Key-A) and IDSN-B = Hash(Key-B). This 903 deterministic generation of the IDSN allows a receiver to ensure that 904 there are no gaps in sequence space at the start of the connection. 905 The SYN with MP_CAPABLE occupies the first octet of data sequence 906 space, although this does not need to be acknowledged at the 907 connection level until the first data is sent (see Section 3.3). 909 3.2. Starting a New Subflow 911 Once an MPTCP connection has begun with the MP_CAPABLE exchange, 912 further subflows can be added to the connection. Hosts have 913 knowledge of their own address(es), and can become aware of the other 914 host's addresses through signaling exchanges as described in 915 Section 3.4. Using this knowledge, a host can initiate a new subflow 916 over a currently unused pair of addresses. It is permitted for 917 either host in a connection to initiate the creation of a new 918 subflow, but it is expected that this will normally be the original 919 connection initiator (see Section 3.10 for heuristics). 921 A new subflow is started as a normal TCP SYN/ACK exchange. The Join 922 Connection (MP_JOIN) MPTCP option is used to identify the connection 923 to be joined by the new subflow. It uses keying material that was 924 exchanged in the initial MP_CAPABLE handshake (Section 3.1), and that 925 handshake also negotiates the crypto algorithm in use for the MP_JOIN 926 handshake. 928 This section specifies the behavior of MP_JOIN using the HMAC-SHA256 929 algorithm. An MP_JOIN option is present in the SYN, SYN/ACK, and ACK 930 of the three-way handshake, although in each case with a different 931 format. 933 In the first MP_JOIN on the SYN packet, illustrated in Figure 5, the 934 initiator sends a token, random number, and address ID. 936 The token is used to identify the MPTCP connection and is a 937 cryptographic hash of the receiver's key, as exchanged in the initial 938 MP_CAPABLE handshake (Section 3.1). In this specification, the 939 tokens presented in this option are generated by the SHA-256 ([SHS], 940 [RFC6234]) algorithm, truncated to the most significant 32 bits. The 941 token included in the MP_JOIN option is the token that the receiver 942 of the packet uses to identify this connection; i.e., Host A will 943 send Token-B (which is generated from Key-B). Note that the hash 944 generation algorithm can be overridden by the choice of cryptographic 945 handshake algorithm, as defined in Section 3.1. 947 The MP_JOIN SYN sends not only the token (which is static for a 948 connection) but also random numbers (nonces) that are used to prevent 949 replay attacks on the authentication method. Recommendations for the 950 generation of random numbers for this purpose are given in [RFC4086]. 952 The MP_JOIN option includes an "Address ID". This is an identifier 953 that only has significance within a single connection, where it 954 identifies the source address of this packet, even if the IP header 955 has been changed in transit by a middlebox. The Address ID allows 956 address removal (Section 3.4.2) without needing to know what the 957 source address at the receiver is, thus allowing address removal 958 through NATs. The Address ID also allows correlation between new 959 subflow setup attempts and address signaling (Section 3.4.1), to 960 prevent setting up duplicate subflows on the same path, if an MP_JOIN 961 and ADD_ADDR are sent at the same time. 963 The Address IDs of the subflow used in the initial SYN exchange of 964 the first subflow in the connection are implicit, and have the value 965 zero. A host MUST store the mappings between Address IDs and 966 addresses both for itself and the remote host. An implementation 967 will also need to know which local and remote Address IDs are 968 associated with which established subflows, for when addresses are 969 removed from a local or remote host. 971 The MP_JOIN option on packets with the SYN flag set also includes 4 972 bits of flags, 3 of which are currently reserved and MUST be set to 973 zero by the sender. The final bit, labeled "B", indicates whether 974 the sender of this option wishes this subflow to be used as a backup 975 path (B=1) in the event of failure of other paths, or whether it 976 wants it to be used as part of the connection immediately. By 977 setting B=1, the sender of the option is requesting the other host to 978 only send data on this subflow if there are no available subflows 979 where B=0. Subflow policy is discussed in more detail in 980 Section 3.3.8. 982 1 2 3 983 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 984 +---------------+---------------+-------+-----+-+---------------+ 985 | Kind | Length = 12 |Subtype| |B| Address ID | 986 +---------------+---------------+-------+-----+-+---------------+ 987 | Receiver's Token (32 bits) | 988 +---------------------------------------------------------------+ 989 | Sender's Random Number (32 bits) | 990 +---------------------------------------------------------------+ 992 Figure 5: Join Connection (MP_JOIN) Option (for Initial SYN) 994 When receiving a SYN with an MP_JOIN option that contains a valid 995 token for an existing MPTCP connection, the recipient SHOULD respond 996 with a SYN/ACK also containing an MP_JOIN option containing a random 997 number and a truncated (leftmost 64 bits) Hash-based Message 998 Authentication Code (HMAC). This version of the option is shown in 999 Figure 6. If the token is unknown, or the host wants to refuse 1000 subflow establishment (for example, due to a limit on the number of 1001 subflows it will permit), the receiver will send back a reset (RST) 1002 signal, analogous to an unknown port in TCP, containing a MP_TCPRST 1003 option (Section 3.6) with an appropriate reason code. Although 1004 calculating an HMAC requires cryptographic operations, it is believed 1005 that the 32-bit token in the MP_JOIN SYN gives sufficient protection 1006 against blind state exhaustion attacks; therefore, there is no need 1007 to provide mechanisms to allow a responder to operate statelessly at 1008 the MP_JOIN stage. 1010 An HMAC is sent by both hosts -- by the initiator (Host A) in the 1011 third packet (the ACK) and by the responder (Host B) in the second 1012 packet (the SYN/ACK). Doing the HMAC exchange at this stage allows 1013 both hosts to have first exchanged random data (in the first two SYN 1014 packets) that is used as the "message". This specification defines 1015 that HMAC as defined in [RFC2104] is used, along with the SHA-256 1016 hash algorithm [SHS] (potentially implemented as in [RFC6234]), thus 1017 generating a 160-bit / 20-octet HMAC. Due to option space 1018 limitations, the HMAC included in the SYN/ACK is truncated to the 1019 leftmost 64 bits, but this is acceptable since random numbers are 1020 used; thus, an attacker only has one chance to guess the HMAC 1021 correctly (if the HMAC is incorrect, the TCP connection is closed, so 1022 a new MP_JOIN negotiation with a new random number is required). 1024 The initiator's authentication information is sent in its first ACK 1025 (the third packet of the handshake), as shown in Figure 7. This data 1026 needs to be sent reliably, since it is the only time this HMAC is 1027 sent; therefore, receipt of this packet MUST trigger a regular TCP 1028 ACK in response, and the packet MUST be retransmitted if this ACK is 1029 not received. In other words, sending the ACK/MP_JOIN packet places 1030 the subflow in the PRE_ESTABLISHED state, and it moves to the 1031 ESTABLISHED state only on receipt of an ACK from the receiver. It is 1032 not permitted to send data while in the PRE_ESTABLISHED state. The 1033 reserved bits in this option MUST be set to zero by the sender. 1035 The key for the HMAC algorithm, in the case of the message 1036 transmitted by Host A, will be Key-A followed by Key-B, and in the 1037 case of Host B, Key-B followed by Key-A. These are the keys that 1038 were exchanged in the original MP_CAPABLE handshake. The "message" 1039 for the HMAC algorithm in each case is the concatenations of random 1040 number for each host (denoted by R): for Host A, R-A followed by R-B; 1041 and for Host B, R-B followed by R-A. 1043 1 2 3 1044 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1045 +---------------+---------------+-------+-----+-+---------------+ 1046 | Kind | Length = 16 |Subtype| |B| Address ID | 1047 +---------------+---------------+-------+-----+-+---------------+ 1048 | | 1049 | Sender's Truncated HMAC (64 bits) | 1050 | | 1051 +---------------------------------------------------------------+ 1052 | Sender's Random Number (32 bits) | 1053 +---------------------------------------------------------------+ 1055 Figure 6: Join Connection (MP_JOIN) Option (for Responding SYN/ACK) 1057 1 2 3 1058 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1059 +---------------+---------------+-------+-----------------------+ 1060 | Kind | Length = 24 |Subtype| (reserved) | 1061 +---------------+---------------+-------+-----------------------+ 1062 | | 1063 | | 1064 | Sender's HMAC (160 bits) | 1065 | | 1066 | | 1067 +---------------------------------------------------------------+ 1069 Figure 7: Join Connection (MP_JOIN) Option (for Third ACK) 1071 These various MPTCP options fit together to enable authenticated 1072 subflow setup as illustrated in Figure 8. 1074 Host A Host B 1075 ------------------------ ---------- 1076 Address A1 Address A2 Address B1 1077 ---------- ---------- ---------- 1078 | | | 1079 | SYN + MP_CAPABLE(Key-A) | 1080 |--------------------------------------------->| 1081 |<---------------------------------------------| 1082 | SYN/ACK + MP_CAPABLE(Key-B) | 1083 | | | 1084 | ACK + MP_CAPABLE(Key-A, Key-B) | 1085 |--------------------------------------------->| 1086 | | | 1087 | | SYN + MP_JOIN(Token-B, R-A) | 1088 | |------------------------------->| 1089 | |<-------------------------------| 1090 | | SYN/ACK + MP_JOIN(HMAC-B, R-B) | 1091 | | | 1092 | | ACK + MP_JOIN(HMAC-A) | 1093 | |------------------------------->| 1094 | |<-------------------------------| 1095 | | ACK | 1097 HMAC-A = HMAC(Key=(Key-A+Key-B), Msg=(R-A+R-B)) 1098 HMAC-B = HMAC(Key=(Key-B+Key-A), Msg=(R-B+R-A)) 1100 Figure 8: Example Use of MPTCP Authentication 1102 If the token received at Host B is unknown or local policy prohibits 1103 the acceptance of the new subflow, the recipient MUST respond with a 1104 TCP RST for the subflow, with a MP_TCPRST option (Section 3.6) with 1105 an appropriate reason code. 1107 If the token is accepted at Host B, but the HMAC returned to Host A 1108 does not match the one expected, Host A MUST close the subflow with a 1109 TCP RST. In this, and all following cases of sending a RST in this 1110 section, the sender SHOULD send a MP_TCPRST option (Section 3.6) on 1111 this RST packet with the reason code for a "MPTCP specific error". 1113 If Host B does not receive the expected HMAC, or the MP_JOIN option 1114 is missing from the ACK, it MUST close the subflow with a TCP RST 1115 with a MP_TCPRST (Section 3.6) option with the reason code for "MPTCP 1116 specific error". 1118 If the HMACs are verified as correct, then both hosts have 1119 authenticated each other as being the same peers as existed at the 1120 start of the connection, and they have agreed of which connection 1121 this subflow will become a part. 1123 If the SYN/ACK as received at Host A does not have an MP_JOIN option, 1124 Host A MUST close the subflow with a TCP RST with a MP_TCPRST 1125 (Section 3.6) option with the reason code for "MPTCP specific error". 1127 This covers all cases of the loss of an MP_JOIN. In more detail, if 1128 MP_JOIN is stripped from the SYN on the path from A to B, and Host B 1129 does not have a passive opener on the relevant port, it will respond 1130 with a RST in the normal way. If in response to a SYN with an 1131 MP_JOIN option, a SYN/ACK is received without the MP_JOIN option 1132 (either since it was stripped on the return path, or it was stripped 1133 on the outgoing path but the passive opener on Host B responded as if 1134 it were a new regular TCP session), then the subflow is unusable and 1135 Host A MUST close it with a RST. 1137 Note that additional subflows can be created between any pair of 1138 ports (but see Section 3.10 for heuristics); no explicit application- 1139 level accept calls or bind calls are required to open additional 1140 subflows. To associate a new subflow with an existing connection, 1141 the token supplied in the subflow's SYN exchange is used for 1142 demultiplexing. This then binds the 5-tuple of the TCP subflow to 1143 the local token of the connection. A consequence is that it is 1144 possible to allow any port pairs to be used for a connection. 1146 Demultiplexing subflow SYNs MUST be done using the token; this is 1147 unlike traditional TCP, where the destination port is used for 1148 demultiplexing SYN packets. Once a subflow is set up, demultiplexing 1149 packets is done using the 5-tuple, as in traditional TCP. The 1150 5-tuples will be mapped to the local connection identifier (token). 1151 Note that Host A will know its local token for the subflow even 1152 though it is not sent on the wire -- only the responder's token is 1153 sent. 1155 3.3. General MPTCP Operation 1157 This section discusses operation of MPTCP for data transfer. At a 1158 high level, an MPTCP implementation will take one input data stream 1159 from an application, and split it into one or more subflows, with 1160 sufficient control information to allow it to be reassembled and 1161 delivered reliably and in order to the recipient application. The 1162 following subsections define this behavior in detail. 1164 The data sequence mapping and the Data ACK are signaled in the Data 1165 Sequence Signal (DSS) option (Figure 9). Either or both can be 1166 signaled in one DSS, depending on the flags set. The data sequence 1167 mapping defines how the sequence space on the subflow maps to the 1168 connection level, and the Data ACK acknowledges receipt of data at 1169 the connection level. These functions are described in more detail 1170 in the following two subsections. 1172 1 2 3 1173 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1174 +---------------+---------------+-------+----------------------+ 1175 | Kind | Length |Subtype| (reserved) |F|m|M|a|A| 1176 +---------------+---------------+-------+----------------------+ 1177 | Data ACK (4 or 8 octets, depending on flags) | 1178 +--------------------------------------------------------------+ 1179 | Data sequence number (4 or 8 octets, depending on flags) | 1180 +--------------------------------------------------------------+ 1181 | Subflow Sequence Number (4 octets) | 1182 +-------------------------------+------------------------------+ 1183 | Data-Level Length (2 octets) | Checksum (2 octets) | 1184 +-------------------------------+------------------------------+ 1186 Figure 9: Data Sequence Signal (DSS) Option 1188 The flags, when set, define the contents of this option, as follows: 1190 o A = Data ACK present 1192 o a = Data ACK is 8 octets (if not set, Data ACK is 4 octets) 1194 o M = Data Sequence Number (DSN), Subflow Sequence Number (SSN), 1195 Data-Level Length, and Checksum present 1197 o m = Data sequence number is 8 octets (if not set, DSN is 4 octets) 1199 The flags 'a' and 'm' only have meaning if the corresponding 'A' or 1200 'M' flags are set; otherwise, they will be ignored. The maximum 1201 length of this option, with all flags set, is 28 octets. 1203 The 'F' flag indicates "DATA_FIN". If present, this means that this 1204 mapping covers the final data from the sender. This is the 1205 connection-level equivalent to the FIN flag in single-path TCP. A 1206 connection is not closed unless there has been a DATA_FIN exchange or 1207 a timeout. The purpose of the DATA_FIN and the interactions between 1208 this flag, the subflow-level FIN flag, and the data sequence mapping 1209 are described in Section 3.3.3. The remaining reserved bits MUST be 1210 set to zero by an implementation of this specification. 1212 Note that the checksum is only present in this option if the use of 1213 MPTCP checksumming has been negotiated at the MP_CAPABLE handshake 1214 (see Section 3.1). The presence of the checksum can be inferred from 1215 the length of the option. If a checksum is present, but its use had 1216 not been negotiated in the MP_CAPABLE handshake, the checksum field 1217 MUST be ignored. If a checksum is not present when its use has been 1218 negotiated, the receiver MUST close the subflow with a RST as it is 1219 considered broken. This RST SHOULD be accompanied with a MP_TCPRST 1220 option (Section 3.6) with the reason code for a "MPTCP specific 1221 error". 1223 3.3.1. Data Sequence Mapping 1225 The data stream as a whole can be reassembled through the use of the 1226 data sequence mapping components of the DSS option (Figure 9), which 1227 define the mapping from the subflow sequence number to the data 1228 sequence number. This is used by the receiver to ensure in-order 1229 delivery to the application layer. Meanwhile, the subflow-level 1230 sequence numbers (i.e., the regular sequence numbers in the TCP 1231 header) have subflow-only relevance. It is expected (but not 1232 mandated) that SACK [RFC2018] is used at the subflow level to improve 1233 efficiency. 1235 The data sequence mapping specifies a mapping from subflow sequence 1236 space to data sequence space. This is expressed in terms of starting 1237 sequence numbers for the subflow and the data level, and a length of 1238 bytes for which this mapping is valid. This explicit mapping for a 1239 range of data was chosen rather than per-packet signaling to assist 1240 with compatibility with situations where TCP/IP segmentation or 1241 coalescing is undertaken separately from the stack that is generating 1242 the data flow (e.g., through the use of TCP segmentation offloading 1243 on network interface cards, or by middleboxes such as performance 1244 enhancing proxies). It also allows a single mapping to cover many 1245 packets, which may be useful in bulk transfer situations. 1247 A mapping is fixed, in that the subflow sequence number is bound to 1248 the data sequence number after the mapping has been processed. A 1249 sender MUST NOT change this mapping after it has been declared; 1250 however, the same data sequence number can be mapped to by different 1251 subflows for retransmission purposes (see Section 3.3.6). This would 1252 also permit the same data to be sent simultaneously on multiple 1253 subflows for resilience or efficiency purposes, especially in the 1254 case of lossy links. Although the detailed specification of such 1255 operation is outside the scope of this document, an implementation 1256 SHOULD treat the first data that is received at a subflow for the 1257 data sequence space as that which should be delivered to the 1258 application, and any later data for that sequence space ignored. 1260 The data sequence number is specified as an absolute value, whereas 1261 the subflow sequence numbering is relative (the SYN at the start of 1262 the subflow has relative subflow sequence number 0). This is to 1263 allow middleboxes to change the initial sequence number of a subflow, 1264 such as firewalls that undertake ISN randomization. 1266 The data sequence mapping also contains a checksum of the data that 1267 this mapping covers, if use of checksums has been negotiated at the 1268 MP_CAPABLE exchange. Checksums are used to detect if the payload has 1269 been adjusted in any way by a non-MPTCP-aware middlebox. If this 1270 checksum fails, it will trigger a failure of the subflow, or a 1271 fallback to regular TCP, as documented in Section 3.8, since MPTCP 1272 can no longer reliably know the subflow sequence space at the 1273 receiver to build data sequence mappings. 1275 The checksum algorithm used is the standard TCP checksum [RFC0793], 1276 operating over the data covered by this mapping, along with a pseudo- 1277 header as shown in Figure 10. 1279 1 2 3 1280 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1281 +--------------------------------------------------------------+ 1282 | | 1283 | Data Sequence Number (8 octets) | 1284 | | 1285 +--------------------------------------------------------------+ 1286 | Subflow Sequence Number (4 octets) | 1287 +-------------------------------+------------------------------+ 1288 | Data-Level Length (2 octets) | Zeros (2 octets) | 1289 +-------------------------------+------------------------------+ 1291 Figure 10: Pseudo-Header for DSS Checksum 1293 Note that the data sequence number used in the pseudo-header is 1294 always the 64-bit value, irrespective of what length is used in the 1295 DSS option itself. The standard TCP checksum algorithm has been 1296 chosen since it will be calculated anyway for the TCP subflow, and if 1297 calculated first over the data before adding the pseudo-headers, it 1298 only needs to be calculated once. Furthermore, since the TCP 1299 checksum is additive, the checksum for a DSN_MAP can be constructed 1300 by simply adding together the checksums for the data of each 1301 constituent TCP segment, and adding the checksum for the DSS pseudo- 1302 header. 1304 Note that checksumming relies on the TCP subflow containing 1305 contiguous data; therefore, a TCP subflow MUST NOT use the Urgent 1306 Pointer to interrupt an existing mapping. Further note, however, 1307 that if Urgent data is received on a subflow, it SHOULD be mapped to 1308 the data sequence space and delivered to the application analogous to 1309 Urgent data in regular TCP. 1311 To avoid possible deadlock scenarios, subflow-level processing should 1312 be undertaken separately from that at connection level. Therefore, 1313 even if a mapping does not exist from the subflow space to the data- 1314 level space, the data SHOULD still be ACKed at the subflow (if it is 1315 in-window). This data cannot, however, be acknowledged at the data 1316 level (Section 3.3.2) because its data sequence numbers are unknown. 1317 Implementations MAY hold onto such unmapped data for a short while in 1318 the expectation that a mapping will arrive shortly. Such unmapped 1319 data cannot be counted as being within the connection level receive 1320 window because this is relative to the data sequence numbers, so if 1321 the receiver runs out of memory to hold this data, it will have to be 1322 discarded. If a mapping for that subflow-level sequence space does 1323 not arrive within a receive window of data, that subflow SHOULD be 1324 treated as broken, closed with a RST, and any unmapped data silently 1325 discarded. 1327 Data sequence numbers are always 64-bit quantities, and MUST be 1328 maintained as such in implementations. If a connection is 1329 progressing at a slow rate, so protection against wrapped sequence 1330 numbers is not required, then an implementation MAY include just the 1331 lower 32 bits of the data sequence number in the data sequence 1332 mapping and/or Data ACK as an optimization, and an implementation can 1333 make this choice independently for each packet. An implementaton 1334 MUST be able to receive and process both 64-bit or 32-bit sequence 1335 number values, but it is not required that an implementation is able 1336 to send both. 1338 An implementation MUST send the full 64-bit data sequence number if 1339 it is transmitting at a sufficiently high rate that the 32-bit value 1340 could wrap within the Maximum Segment Lifetime (MSL) [RFC1323]. The 1341 lengths of the DSNs used in these values (which may be different) are 1342 declared with flags in the DSS option. Implementations MUST accept a 1343 32-bit DSN and implicitly promote it to a 64-bit quantity by 1344 incrementing the upper 32 bits of sequence number each time the lower 1345 32 bits wrap. A sanity check MUST be implemented to ensure that a 1346 wrap occurs at an expected time (e.g., the sequence number jumps from 1347 a very high number to a very low number) and is not triggered by out- 1348 of-order packets. 1350 As with the standard TCP sequence number, the data sequence number 1351 should not start at zero, but at a random value to make blind session 1352 hijacking harder. This specification requires setting the initial 1353 data sequence number (IDSN) of each host to the least significant 64 1354 bits of the SHA-256 hash of the host's key, as described in 1355 Section 3.1. This is required also in order for the receiver to know 1356 what the expected IDSN is, and thus determine if any initial 1357 connection-level packets are missing; this is particularly relevant 1358 if two subflows start transmitting simultaneously. 1360 A data sequence mapping does not need to be included in every MPTCP 1361 packet, as long as the subflow sequence space in that packet is 1362 covered by a mapping known at the receiver. This can be used to 1363 reduce overhead in cases where the mapping is known in advance; one 1364 such case is when there is a single subflow between the hosts, 1365 another is when segments of data are scheduled in larger than packet- 1366 sized chunks. 1368 An "infinite" mapping can be used to fall back to regular TCP by 1369 mapping the subflow-level data to the connection-level data for the 1370 remainder of the connection (see Section 3.8). This is achieved by 1371 setting the Data-Level Length field of the DSS option to the reserved 1372 value of 0. The checksum, in such a case, will also be set to zero. 1374 3.3.2. Data Acknowledgments 1376 To provide full end-to-end resilience, MPTCP provides a connection- 1377 level acknowledgment, to act as a cumulative ACK for the connection 1378 as a whole. This is the "Data ACK" field of the DSS option 1379 (Figure 9). The Data ACK is analogous to the behavior of the 1380 standard TCP cumulative ACK -- indicating how much data has been 1381 successfully received (with no holes). This is in comparison to the 1382 subflow-level ACK, which acts analogous to TCP SACK, given that there 1383 may still be holes in the data stream at the connection level. The 1384 Data ACK specifies the next data sequence number it expects to 1385 receive. 1387 The Data ACK, as for the DSN, can be sent as the full 64-bit value, 1388 or as the lower 32 bits. If data is received with a 64-bit DSN, it 1389 MUST be acknowledged with a 64-bit Data ACK. If the DSN received is 1390 32 bits, it is valid for the implementation to choose whether to send 1391 a 32-bit or 64-bit Data ACK. 1393 The Data ACK proves that the data, and all required MPTCP signaling, 1394 has been received and accepted by the remote end. One key use of the 1395 Data ACK signal is that it is used to indicate the left edge of the 1396 advertised receive window. As explained in Section 3.3.4, the 1397 receive window is shared by all subflows and is relative to the Data 1398 ACK. Because of this, an implementation MUST NOT use the RCV.WND 1399 field of a TCP segment at the connection level if it does not also 1400 carry a DSS option with a Data ACK field. Furthermore, separating 1401 the connection-level acknowledgments from the subflow level allows 1402 processing to be done separately, and a receiver has the freedom to 1403 drop segments after acknowledgment at the subflow level, for example, 1404 due to memory constraints when many segments arrive out of order. 1406 An MPTCP sender MUST NOT free data from the send buffer until it has 1407 been acknowledged by both a Data ACK received on any subflow and at 1408 the subflow level by all subflows on which the data was sent. The 1409 former condition ensures liveness of the connection and the latter 1410 condition ensures liveness and self-consistence of a subflow when 1411 data needs to be retransmitted. Note, however, that if some data 1412 needs to be retransmitted multiple times over a subflow, there is a 1413 risk of blocking the sending window. In this case, the MPTCP sender 1414 can decide to terminate the subflow that is behaving badly by sending 1415 a RST, using an appropriate MP_TCPRST (Section 3.6) error code. 1417 The Data ACK MAY be included in all segments; however, optimizations 1418 SHOULD be considered in more advanced implementations, where the Data 1419 ACK is present in segments only when the Data ACK value advances, and 1420 this behavior MUST be treated as valid. This behavior ensures the 1421 sender buffer is freed, while reducing overhead when the data 1422 transfer is unidirectional. 1424 3.3.3. Closing a Connection 1426 In regular TCP, a FIN announces the receiver that the sender has no 1427 more data to send. In order to allow subflows to operate 1428 independently and to keep the appearance of TCP over the wire, a FIN 1429 in MPTCP only affects the subflow on which it is sent. This allows 1430 nodes to exercise considerable freedom over which paths are in use at 1431 any one time. The semantics of a FIN remain as for regular TCP; 1432 i.e., it is not until both sides have ACKed each other's FINs that 1433 the subflow is fully closed. 1435 When an application calls close() on a socket, this indicates that it 1436 has no more data to send; for regular TCP, this would result in a FIN 1437 on the connection. For MPTCP, an equivalent mechanism is needed, and 1438 this is referred to as the DATA_FIN. 1440 A DATA_FIN is an indication that the sender has no more data to send, 1441 and as such can be used to verify that all data has been successfully 1442 received. A DATA_FIN, as with the FIN on a regular TCP connection, 1443 is a unidirectional signal. 1445 The DATA_FIN is signaled by setting the 'F' flag in the Data Sequence 1446 Signal option (Figure 9) to 1. A DATA_FIN occupies 1 octet (the 1447 final octet) of the connection-level sequence space. Note that the 1448 DATA_FIN is included in the Data-Level Length, but not at the subflow 1449 level: for example, a segment with DSN 80, and Data-Level Length 11, 1450 with DATA_FIN set, would map 10 octets from the subflow into data 1451 sequence space 80-89, the DATA_FIN is DSN 90; therefore, this segment 1452 including DATA_FIN would be acknowledged with a DATA_ACK of 91. 1454 Note that when the DATA_FIN is not attached to a TCP segment 1455 containing data, the Data Sequence Signal MUST have a subflow 1456 sequence number of 0, a Data-Level Length of 1, and the data sequence 1457 number that corresponds with the DATA_FIN itself. The checksum in 1458 this case will only cover the pseudo-header. 1460 A DATA_FIN has the semantics and behavior as a regular TCP FIN, but 1461 at the connection level. Notably, it is only DATA_ACKed once all 1462 data has been successfully received at the connection level. Note, 1463 therefore, that a DATA_FIN is decoupled from a subflow FIN. It is 1464 only permissible to combine these signals on one subflow if there is 1465 no data outstanding on other subflows. Otherwise, it may be 1466 necessary to retransmit data on different subflows. Essentially, a 1467 host MUST NOT close all functioning subflows unless it is safe to do 1468 so, i.e., until all outstanding data has been DATA_ACKed, or until 1469 the segment with the DATA_FIN flag set is the only outstanding 1470 segment. 1472 Once a DATA_FIN has been acknowledged, all remaining subflows MUST be 1473 closed with standard FIN exchanges. Both hosts SHOULD send FINs on 1474 all subflows, as a courtesy to allow middleboxes to clean up state 1475 even if an individual subflow has failed. It is also encouraged to 1476 reduce the timeouts (Maximum Segment Life) on subflows at end hosts. 1477 In particular, any subflows where there is still outstanding data 1478 queued (which has been retransmitted on other subflows in order to 1479 get the DATA_FIN acknowledged) MAY be closed with a RST with 1480 MP_TCPRST (Section 3.6) error code for "too much outstanding data". 1482 A connection is considered closed once both hosts' DATA_FINs have 1483 been acknowledged by DATA_ACKs. 1485 As specified above, a standard TCP FIN on an individual subflow only 1486 shuts down the subflow on which it was sent. If all subflows have 1487 been closed with a FIN exchange, but no DATA_FIN has been received 1488 and acknowledged, the MPTCP connection is treated as closed only 1489 after a timeout. This implies that an implementation will have 1490 TIME_WAIT states at both the subflow and connection levels (see 1491 Appendix C). This permits "break-before-make" scenarios where 1492 connectivity is lost on all subflows before a new one can be re- 1493 established. 1495 3.3.4. Receiver Considerations 1497 Regular TCP advertises a receive window in each packet, telling the 1498 sender how much data the receiver is willing to accept past the 1499 cumulative ack. The receive window is used to implement flow 1500 control, throttling down fast senders when receivers cannot keep up. 1502 MPTCP also uses a unique receive window, shared between the subflows. 1503 The idea is to allow any subflow to send data as long as the receiver 1504 is willing to accept it. The alternative, maintaining per subflow 1505 receive windows, could end up stalling some subflows while others 1506 would not use up their window. 1508 The receive window is relative to the DATA_ACK. As in TCP, a 1509 receiver MUST NOT shrink the right edge of the receive window (i.e., 1510 DATA_ACK + receive window). The receiver will use the data sequence 1511 number to tell if a packet should be accepted at the connection 1512 level. 1514 When deciding to accept packets at subflow level, regular TCP checks 1515 the sequence number in the packet against the allowed receive window. 1516 With multipath, such a check is done using only the connection-level 1517 window. A sanity check SHOULD be performed at subflow level to 1518 ensure that the subflow and mapped sequence numbers meet the 1519 following test: SSN - SUBFLOW_ACK <= DSN - DATA_ACK, where SSN is the 1520 subflow sequence number of the received packet and SUBFLOW_ACK is the 1521 RCV.NXT (next expected sequence number) of the subflow (with the 1522 equivalent connection-level definitions for DSN and DATA_ACK). 1524 In regular TCP, once a segment is deemed in-window, it is put either 1525 in the in-order receive queue or in the out-of-order queue. In 1526 Multipath TCP, the same happens but at the connection level: a 1527 segment is placed in the connection level in-order or out-of-order 1528 queue if it is in-window at both connection and subflow levels. The 1529 stack still has to remember, for each subflow, which segments were 1530 received successfully so that it can ACK them at subflow level 1531 appropriately. Typically, this will be implemented by keeping per 1532 subflow out-of-order queues (containing only message headers, not the 1533 payloads) and remembering the value of the cumulative ACK. 1535 It is important for implementers to understand how large a receiver 1536 buffer is appropriate. The lower bound for full network utilization 1537 is the maximum bandwidth-delay product of any one of the paths. 1538 However, this might be insufficient when a packet is lost on a slower 1539 subflow and needs to be retransmitted (see Section 3.3.6). A tight 1540 upper bound would be the maximum round-trip time (RTT) of any path 1541 multiplied by the total bandwidth available across all paths. This 1542 permits all subflows to continue at full speed while a packet is 1543 fast-retransmitted on the maximum RTT path. Even this might be 1544 insufficient to maintain full performance in the event of a 1545 retransmit timeout on the maximum RTT path. It is for future study 1546 to determine the relationship between retransmission strategies and 1547 receive buffer sizing. 1549 3.3.5. Sender Considerations 1551 The sender remembers receiver window advertisements from the 1552 receiver. It should only update its local receive window values when 1553 the largest sequence number allowed (i.e., DATA_ACK + receive window) 1554 increases, on the receipt of a DATA_ACK. This is important to allow 1555 using paths with different RTTs, and thus different feedback loops. 1557 MPTCP uses a single receive window across all subflows, and if the 1558 receive window was guaranteed to be unchanged end-to-end, a host 1559 could always read the most recent receive window value. However, 1560 some classes of middleboxes may alter the TCP-level receive window. 1561 Typically, these will shrink the offered window, although for short 1562 periods of time it may be possible for the window to be larger 1563 (however, note that this would not continue for long periods since 1564 ultimately the middlebox must keep up with delivering data to the 1565 receiver). Therefore, if receive window sizes differ on multiple 1566 subflows, when sending data MPTCP SHOULD take the largest of the most 1567 recent window sizes as the one to use in calculations. This rule is 1568 implicit in the requirement not to reduce the right edge of the 1569 window. 1571 The sender MUST also remember the receive windows advertised by each 1572 subflow. The allowed window for subflow i is (ack_i, ack_i + 1573 rcv_wnd_i), where ack_i is the subflow-level cumulative ACK of 1574 subflow i. This ensures data will not be sent to a middlebox unless 1575 there is enough buffering for the data. 1577 Putting the two rules together, we get the following: a sender is 1578 allowed to send data segments with data-level sequence numbers 1579 between (DATA_ACK, DATA_ACK + receive_window). Each of these 1580 segments will be mapped onto subflows, as long as subflow sequence 1581 numbers are in the allowed windows for those subflows. Note that 1582 subflow sequence numbers do not generally affect flow control if the 1583 same receive window is advertised across all subflows. They will 1584 perform flow control for those subflows with a smaller advertised 1585 receive window. 1587 The send buffer MUST, at a minimum, be as big as the receive buffer, 1588 to enable the sender to reach maximum throughput. 1590 3.3.6. Reliability and Retransmissions 1592 The data sequence mapping allows senders to resend data with the same 1593 data sequence number on a different subflow. When doing this, a host 1594 MUST still retransmit the original data on the original subflow, in 1595 order to preserve the subflow integrity (middleboxes could replay old 1596 data, and/or could reject holes in subflows), and a receiver will 1597 ignore these retransmissions. While this is clearly suboptimal, for 1598 compatibility reasons this is sensible behavior. Optimizations could 1599 be negotiated in future versions of this protocol. Note also that 1600 this property would also permit a sender to always send the same 1601 data, with the same data sequence number, on multiple subflows, if it 1602 so desired for reliability reasons. 1604 This protocol specification does not mandate any mechanisms for 1605 handling retransmissions, and much will be dependent upon local 1606 policy (as discussed in Section 3.3.8). One can imagine aggressive 1607 connection-level retransmissions policies where every packet lost at 1608 subflow level is retransmitted on a different subflow (hence, wasting 1609 bandwidth but possibly reducing application-to-application delays), 1610 or conservative retransmission policies where connection-level 1611 retransmits are only used after a few subflow-level retransmission 1612 timeouts occur. 1614 It is envisaged that a standard connection-level retransmission 1615 mechanism would be implemented around a connection-level data queue: 1616 all segments that haven't been DATA_ACKed are stored. A timer is set 1617 when the head of the connection-level is ACKed at subflow level but 1618 its corresponding data is not ACKed at data level. This timer will 1619 guard against failures in retransmission by middleboxes that 1620 proactively ACK data. 1622 The sender MUST keep data in its send buffer as long as the data has 1623 not been acknowledged at both connection level and on all subflows on 1624 which it has been sent. In this way, the sender can always 1625 retransmit the data if needed, on the same subflow or on a different 1626 one. A special case is when a subflow fails: the sender will 1627 typically resend the data on other working subflows after a timeout, 1628 and will keep trying to retransmit the data on the failed subflow 1629 too. The sender will declare the subflow failed after a predefined 1630 upper bound on retransmissions is reached (which MAY be lower than 1631 the usual TCP limits of the Maximum Segment Life), or on the receipt 1632 of an ICMP error, and only then delete the outstanding data segments. 1634 Multiple retransmissions are triggers that will indicate that a 1635 subflow performs badly and could lead to a host resetting the subflow 1636 with a RST. However, additional research is required to understand 1637 the heuristics of how and when to reset underperforming subflows. 1638 For example, a highly asymmetric path may be misdiagnosed as 1639 underperforming. A RST for this purpose SHOULD be accompanied with 1640 an appropriate MP_TCPRST option (Section 3.6). 1642 3.3.7. Congestion Control Considerations 1644 Different subflows in an MPTCP connection have different congestion 1645 windows. To achieve fairness at bottlenecks and resource pooling, it 1646 is necessary to couple the congestion windows in use on each subflow, 1647 in order to push most traffic to uncongested links. One algorithm 1648 for achieving this is presented in [RFC6356]; the algorithm does not 1649 achieve perfect resource pooling but is "safe" in that it is readily 1650 deployable in the current Internet. By this, we mean that it does 1651 not take up more capacity on any one path than if it was a single 1652 path flow using only that route, so this ensures fair coexistence 1653 with single-path TCP at shared bottlenecks. 1655 It is foreseeable that different congestion controllers will be 1656 implemented for MPTCP, each aiming to achieve different properties in 1657 the resource pooling/fairness/stability design space, as well as 1658 those for achieving different properties in quality of service, 1659 reliability, and resilience. 1661 Regardless of the algorithm used, the design of the MPTCP protocol 1662 aims to provide the congestion control implementations sufficient 1663 information to take the right decisions; this information includes, 1664 for each subflow, which packets were lost and when. 1666 3.3.8. Subflow Policy 1668 Within a local MPTCP implementation, a host may use any local policy 1669 it wishes to decide how to share the traffic to be sent over the 1670 available paths. 1672 In the typical use case, where the goal is to maximize throughput, 1673 all available paths will be used simultaneously for data transfer, 1674 using coupled congestion control as described in [RFC6356]. It is 1675 expected, however, that other use cases will appear. 1677 For instance, a possibility is an 'all-or-nothing' approach, i.e., 1678 have a second path ready for use in the event of failure of the first 1679 path, but alternatives could include entirely saturating one path 1680 before using an additional path (the 'overflow' case). Such choices 1681 would be most likely based on the monetary cost of links, but may 1682 also be based on properties such as the delay or jitter of links, 1683 where stability (of delay or bandwidth) is more important than 1684 throughput. Application requirements such as these are discussed in 1685 detail in [RFC6897]. 1687 The ability to make effective choices at the sender requires full 1688 knowledge of the path "cost", which is unlikely to be the case. It 1689 would be desirable for a receiver to be able to signal their own 1690 preferences for paths, since they will often be the multihomed party, 1691 and may have to pay for metered incoming bandwidth. 1693 Whilst fine-grained control may be the most powerful solution, that 1694 would require some mechanism such as overloading the Explicit 1695 Congestion Notification (ECN) signal [RFC3168], which is undesirable, 1696 and it is felt that there would not be sufficient benefit to justify 1697 an entirely new signal. Therefore, the MP_JOIN option (see 1698 Section 3.2) contains the 'B' bit, which allows a host to indicate to 1699 its peer that this path should be treated as a backup path to use 1700 only in the event of failure of other working subflows (i.e., a 1701 subflow where the receiver has indicated B=1 SHOULD NOT be used to 1702 send data unless there are no usable subflows where B=0). 1704 In the event that the available set of paths changes, a host may wish 1705 to signal a change in priority of subflows to the peer (e.g., a 1706 subflow that was previously set as backup should now take priority 1707 over all remaining subflows). Therefore, the MP_PRIO option, shown 1708 in Figure 11, can be used to change the 'B' flag of the subflow on 1709 which it is sent. 1711 1 2 3 1712 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1713 +---------------+---------------+-------+-----+-+ 1714 | Kind | Length |Subtype| |B| 1715 +---------------+---------------+-------+-----+-+ 1717 Figure 11: Change Subflow Priority (MP_PRIO) Option 1719 It should be noted that the backup flag is a request from a data 1720 receiver to a data sender only, and the data sender SHOULD adhere to 1721 these requests. A host cannot assume that the data sender will do 1722 so, however, since local policies -- or technical difficulties -- may 1723 override MP_PRIO requests. Note also that this signal applies to a 1724 single direction, and so the sender of this option could choose to 1725 continue using the subflow to send data even if it has signaled B=1 1726 to the other host. 1728 3.4. Address Knowledge Exchange (Path Management) 1730 We use the term "path management" to refer to the exchange of 1731 information about additional paths between hosts, which in this 1732 design is managed by multiple addresses at hosts. For more detail of 1733 the architectural thinking behind this design, see the MPTCP 1734 Architecture document [RFC6182]. 1736 This design makes use of two methods of sharing such information, and 1737 both can be used on a connection. The first is the direct setup of 1738 new subflows, already described in Section 3.2, where the initiator 1739 has an additional address. The second method, described in the 1740 following subsections, signals addresses explicitly to the other host 1741 to allow it to initiate new subflows. The two mechanisms are 1742 complementary: the first is implicit and simple, while the explicit 1743 is more complex but is more robust. Together, the mechanisms allow 1744 addresses to change in flight (and thus support operation through 1745 NATs, since the source address need not be known), and also allow the 1746 signaling of previously unknown addresses, and of addresses belonging 1747 to other address families (e.g., both IPv4 and IPv6). 1749 Here is an example of typical operation of the protocol: 1751 o An MPTCP connection is initially set up between address/port A1 of 1752 Host A and address/port B1 of Host B. If Host A is multihomed and 1753 multiaddressed, it can start an additional subflow from its 1754 address A2 to B1, by sending a SYN with a Join option from A2 to 1755 B1, using B's previously declared token for this connection. 1756 Alternatively, if B is multihomed, it can try to set up a new 1757 subflow from B2 to A1, using A's previously declared token. In 1758 either case, the SYN will be sent to the port already in use for 1759 the original subflow on the receiving host. 1761 o Simultaneously (or after a timeout), an ADD_ADDR option 1762 (Section 3.4.1) is sent on an existing subflow, informing the 1763 receiver of the sender's alternative address(es). The recipient 1764 can use this information to open a new subflow to the sender's 1765 additional address. In our example, A will send ADD_ADDR option 1766 informing B of address/port A2. The mix of using the SYN-based 1767 option and the ADD_ADDR option, including timeouts, is 1768 implementation specific and can be tailored to agree with local 1769 policy. 1771 o If subflow A2-B1 is successfully set up, Host B can use the 1772 Address ID in the Join option to correlate this with the ADD_ADDR 1773 option that will also arrive on an existing subflow; now B knows 1774 not to open A2-B1, ignoring the ADD_ADDR. Otherwise, if B has not 1775 received the A2-B1 MP_JOIN SYN but received the ADD_ADDR, it can 1776 try to initiate a new subflow from one or more of its addresses to 1777 address A2. This permits new sessions to be opened if one host is 1778 behind a NAT. 1780 Other ways of using the two signaling mechanisms are possible; for 1781 instance, signaling addresses in other address families can only be 1782 done explicitly using the Add Address option. 1784 3.4.1. Address Advertisement 1786 The Add Address (ADD_ADDR) MPTCP option announces additional 1787 addresses (and optionally, ports) on which a host can be reached 1788 (Figure 12). This option can be used at any time during a 1789 connection, depending on when the sender wishes to enable multiple 1790 paths and/or when paths become available. As with all MPTCP signals, 1791 the receiver MUST undertake standard TCP validity checks, e.g. 1792 [RFC5961], before acting upon it. 1794 Every address has an Address ID that can be used for uniquely 1795 identifying the address within a connection for address removal. 1796 This is also used to identify MP_JOIN options (see Section 3.2) 1797 relating to the same address, even when address translators are in 1798 use. The Address ID MUST uniquely identify the address to the sender 1799 (within the scope of the connection), but the mechanism for 1800 allocating such IDs is implementation specific. 1802 All address IDs learned via either MP_JOIN or ADD_ADDR SHOULD be 1803 stored by the receiver in a data structure that gathers all the 1804 Address ID to address mappings for a connection (identified by a 1805 token pair). In this way, there is a stored mapping between Address 1806 ID, observed source address, and token pair for future processing of 1807 control information for a connection. Note that an implementation 1808 MAY discard incoming address advertisements at will, for example, for 1809 avoiding the required mapping state, or because advertised addresses 1810 are of no use to it (for example, IPv6 addresses when it has IPv4 1811 only). Therefore, a host MUST treat address advertisements as soft 1812 state, and it MAY choose to refresh advertisements periodically. 1814 This option is shown in Figure 12. The illustration is sized for 1815 IPv4 addresses. For IPv6, the length of the address will be 16 1816 octets (instead of 4). 1818 The 2 octets that specify the TCP port number to use are optional and 1819 their presence can be inferred from the length of the option. 1820 Although it is expected that the majority of use cases will use the 1821 same port pairs as used for the initial subflow (e.g., port 80 1822 remains port 80 on all subflows, as does the ephemeral port at the 1823 client), there may be cases (such as port-based load balancing) where 1824 the explicit specification of a different port is required. If no 1825 port is specified, MPTCP SHOULD attempt to connect to the specified 1826 address on the same port as is already in use by the subflow on which 1827 the ADD_ADDR signal was sent; this is discussed in more detail in 1828 Section 3.10. 1830 The Truncated HMAC present in this Option is the rightmost 64 bits of 1831 an HMAC, negotiated and calculated in the same way as for MP_JOIN as 1832 described in Section 3.2. For this specification of MPTCP, as there 1833 is only one hash algorithm option specified, this will be HMAC as 1834 defined in [RFC2104], using the SHA-256 hash algorithm [SHS], 1835 implemented as in [RFC6234]. In the same way as for MP_JOIN, the key 1836 for the HMAC algorithm, in the case of the message transmitted by 1837 Host A, will be Key-A followed by Key-B, and in the case of Host B, 1838 Key-B followed by Key-A. These are the keys that were exchanged in 1839 the original MP_CAPABLE handshake. The message for the HMAC is the 1840 Address ID, IP Address, and Port which precede the HMAC in the 1841 ADD_ADDR option. If the port is not present in the ADD_ADDR option, 1842 the HMAC message will nevertheless include two octets of value zero. 1843 The rationale for the HMAC is to prevent unauthorized entities from 1844 injecting ADD_ADDR signals in an attempt to hijack a connection. 1846 Note that additionally the presence of this HMAC prevents the address 1847 being changed in flight unless the key is known by an intermediary. 1848 If a host receives an ADD_ADDR option for which it cannot validate 1849 the HMAC, it SHOULD silently ignore the option. 1851 A set of four flags are present after the subtype and before the 1852 Address ID. Only the rightmost bit - labelled 'E' - is assinged 1853 today. The other bits are currently unassigned and MUST be set to 1854 zero by a sender and MUST be ignored by the receiver. 1856 The 'E' bit exists to provide reliability for this option. Because 1857 this option will often be sent on pure ACKs, there is no guarantee of 1858 reliability. Therefore, a receiver receiving a fresh ADD_ADDR option 1859 (where E=0), will send the same option back to the sender, but not 1860 including the HMAC, and with E=1. The lack of this echo can be used 1861 by the initial ADD_ADDR sender to retransmit the ADD_ADDR according 1862 to local policy. 1864 1 2 3 1865 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1866 +---------------+---------------+-------+-------+---------------+ 1867 | Kind | Length |Subtype|(rsv)|E| Address ID | 1868 +---------------+---------------+-------+-------+---------------+ 1869 | Address (IPv4 - 4 octets / IPv6 - 16 octets) | 1870 +-------------------------------+-------------------------------+ 1871 | Port (2 octets, optional) | | 1872 +-------------------------------+ | 1873 | Truncated HMAC (8 octets, if length > 10 octets) | 1874 | +-------------------------------+ 1875 | | 1876 +-------------------------------+ 1878 Figure 12: Add Address (ADD_ADDR) Option 1880 Due to the proliferation of NATs, it is reasonably likely that one 1881 host may attempt to advertise private addresses [RFC1918]. It is not 1882 desirable to prohibit this, since there may be cases where both hosts 1883 have additional interfaces on the same private network, and a host 1884 MAY want to advertise such addresses. The MP_JOIN handshake to 1885 create a new subflow (Section 3.2) provides mechanisms to minimize 1886 security risks. The MP_JOIN message contains a 32-bit token that 1887 uniquely identifies the connection to the receiving host. If the 1888 token is unknown, the host will return with a RST. In the unlikely 1889 event that the token is known, subflow setup will continue, but the 1890 HMAC exchange must occur for authentication. This will fail, and 1891 will provide sufficient protection against two unconnected hosts 1892 accidentally setting up a new subflow upon the signal of a private 1893 address. Further security considerations around the issue of 1894 ADD_ADDR messages that accidentally misdirect, or maliciously direct, 1895 new MP_JOIN attempts are discussed in Section 5. 1897 Ideally, ADD_ADDR and REMOVE_ADDR options would be sent reliably, and 1898 in order, to the other end. This would ensure that this address 1899 management does not unnecessarily cause an outage in the connection 1900 when remove/add addresses are processed in reverse order, and also to 1901 ensure that all possible paths are used. Note, however, that losing 1902 reliability and ordering will not break the multipath connections, it 1903 will just reduce the opportunity to open multipath paths and to 1904 survive different patterns of path failures. 1906 Therefore, implementing reliability signals for these MPTCP options 1907 is not necessary. In order to minimize the impact of the loss of 1908 these options, however, it is RECOMMENDED that a sender should send 1909 these options on all available subflows. If these options need to be 1910 received in order, an implementation SHOULD only send one ADD_ADDR/ 1911 REMOVE_ADDR option per RTT, to minimize the risk of misordering. 1913 A host can send an ADD_ADDR message with an already assigned Address 1914 ID, but the Address MUST be the same as previously assigned to this 1915 Address ID, and the Port MUST be different from one already in use 1916 for this Address ID. If these conditions are not met, the receiver 1917 SHOULD silently ignore the ADD_ADDR. A host wishing to replace an 1918 existing Address ID MUST first remove the existing one 1919 (Section 3.4.2). 1921 A host that receives an ADD_ADDR but finds a connection set up to 1922 that IP address and port number is unsuccessful SHOULD NOT perform 1923 further connection attempts to this address/port combination for this 1924 connection. A sender that wants to trigger a new incoming connection 1925 attempt on a previously advertised address/port combination can 1926 therefore refresh ADD_ADDR information by sending the option again. 1928 During normal MPTCP operation, it is unlikely that there will be 1929 sufficient TCP option space for ADD_ADDR to be included along with 1930 those for data sequence numbering (Section 3.3.1). Therefore, it is 1931 expected that an MPTCP implementation will send the ADD_ADDR option 1932 on separate ACKs. As discussed earlier, however, an MPTCP 1933 implementation MUST NOT treat duplicate ACKs with any MPTCP option, 1934 with the exception of the DSS option, as indications of congestion 1935 [RFC5681], and an MPTCP implementation SHOULD NOT send more than two 1936 duplicate ACKs in a row for signaling purposes. 1938 3.4.2. Remove Address 1940 If, during the lifetime of an MPTCP connection, a previously 1941 announced address becomes invalid (e.g., if the interface 1942 disappears), the affected host SHOULD announce this so that the peer 1943 can remove subflows related to this address. 1945 This is achieved through the Remove Address (REMOVE_ADDR) option 1946 (Figure 13), which will remove a previously added address (or list of 1947 addresses) from a connection and terminate any subflows currently 1948 using that address. 1950 For security purposes, if a host receives a REMOVE_ADDR option, it 1951 must ensure the affected path(s) are no longer in use before it 1952 instigates closure. The receipt of REMOVE_ADDR SHOULD first trigger 1953 the sending of a TCP keepalive [RFC1122] on the path, and if a 1954 response is received the path SHOULD NOT be removed. Typical TCP 1955 validity tests on the subflow (e.g., ensuring sequence and ACK 1956 numbers are correct) MUST also be undertaken. An implementation can 1957 use indications of these test failures as part of intrusion detection 1958 or error logging. 1960 The sending and receipt (if no keepalive response was received) of 1961 this message SHOULD trigger the sending of RSTs by both hosts on the 1962 affected subflow(s) (if possible), as a courtesy to cleaning up 1963 middlebox state, before cleaning up any local state. 1965 Address removal is undertaken by ID, so as to permit the use of NATs 1966 and other middleboxes that rewrite source addresses. If there is no 1967 address at the requested ID, the receiver will silently ignore the 1968 request. 1970 A subflow that is still functioning MUST be closed with a FIN 1971 exchange as in regular TCP, rather than using this option. For more 1972 information, see Section 3.3.3. 1974 1 2 3 1975 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1976 +---------------+---------------+-------+-------+---------------+ 1977 | Kind | Length = 3+n |Subtype|(resvd)| Address ID | ... 1978 +---------------+---------------+-------+-------+---------------+ 1979 (followed by n-1 Address IDs, if required) 1981 Figure 13: Remove Address (REMOVE_ADDR) Option 1983 3.5. Fast Close 1985 Regular TCP has the means of sending a reset (RST) signal to abruptly 1986 close a connection. With MPTCP, a regular RST only has the scope of 1987 the subflow and will only close the concerned subflow but not affect 1988 the remaining subflows. MPTCP's connection will stay alive at the 1989 data level, in order to permit break-before-make handover between 1990 subflows. It is therefore necessary to provide an MPTCP-level 1991 "reset" to allow the abrupt closure of the whole MPTCP connection, 1992 and this is the MP_FASTCLOSE option. 1994 MP_FASTCLOSE is used to indicate to the peer that the connection will 1995 be abruptly closed and no data will be accepted anymore. The reasons 1996 for triggering an MP_FASTCLOSE are implementation specific. Regular 1997 TCP does not allow sending a RST while the connection is in a 1998 synchronized state [RFC0793]. Nevertheless, implementations allow 1999 the sending of a RST in this state, if, for example, the operating 2000 system is running out of resources. In these cases, MPTCP should 2001 send the MP_FASTCLOSE. This option is illustrated in Figure 14. 2003 1 2 3 2004 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2005 +---------------+---------------+-------+-----------------------+ 2006 | Kind | Length |Subtype| (reserved) | 2007 +---------------+---------------+-------+-----------------------+ 2008 | Option Receiver's Key | 2009 | (64 bits) | 2010 | | 2011 +---------------------------------------------------------------+ 2013 Figure 14: Fast Close (MP_FASTCLOSE) Option 2015 If Host A wants to force the closure of an MPTCP connection, it has 2016 two different options: 2018 o Option A (ACK) : Host A sends an ACK containing the MP_FASTCLOSE 2019 option on one subflow, containing the key of Host B as declared in 2020 the initial connection handshake. On all the other subflows, Host 2021 A sends a regular TCP RST to close these subflows, and tears them 2022 down. Host A now enters FASTCLOSE_WAIT state. 2024 o Option R (RST) : Host A sends a RST containing the MP_FASTCLOSE 2025 option on all subflows, containing the key of Host B as declared 2026 in the initial connection handshake. Host A can tear the subflows 2027 and the connection down immediately. 2029 If a host receives a packet with a valid MP_FASTCLOSE option, it 2030 shall process it as follows : 2032 o Upon receipt of an ACK with MP_FASTCLOSE, containing the valid 2033 key, Host B answers on the same subflow with a TCP RST and tears 2034 down all subflows. Host B can now close the whole MPTCP 2035 connection (it transitions directly to CLOSED state). 2037 o As soon as Host A has received the TCP RST on the remaining 2038 subflow, it can close this subflow and tear down the whole 2039 connection (transition from FASTCLOSE_WAIT to CLOSED states). If 2040 Host A receives an MP_FASTCLOSE instead of a TCP RST, both hosts 2041 attempted fast closure simultaneously. Host A should reply with a 2042 TCP RST and tear down the connection. 2044 o If Host A does not receive a TCP RST in reply to its MP_FASTCLOSE 2045 after one retransmission timeout (RTO) (the RTO of the subflow 2046 where the MP_FASTCLOSE has been sent), it SHOULD retransmit the 2047 MP_FASTCLOSE. The number of retransmissions SHOULD be limited to 2048 avoid this connection from being retained for a long time, but 2049 this limit is implementation specific. A RECOMMENDED number is 3. 2050 If no TCP RST is received in response, Host A SHOULD send a TCP 2051 RST with the MP_FASTCLOSE option itself when it releases state in 2052 order to clear any remaining state at middleboxes. 2054 o Upon receipt of a RST with MP_FASTCLOSE, containing the valid key, 2055 Host B tears down all subflows. Host B can now close the whole 2056 MPTCP connection (it transitions directly to CLOSED state). 2058 3.6. Subflow Reset 2060 As discussed in Section 3.5 above, the MP_FASTCLOSE option provides a 2061 connection-level reset roughly analagous to a TCP RST. Regular TCP 2062 RST options remain used to at the subflow-level to indicate the 2063 receiving host has no knowledge of the MPTCP subflow or TCP 2064 connection to which the packet belongs. 2066 However, in MPTCP, there may be many reasons for rejecting the 2067 opening of a subflow, but these semantics cannot be carried in a 2068 standard TCP RST. It would be beneficial for a host to the reasons 2069 why its subflow has been closed with a RST, and thus whether it 2070 should try to re-establish the subflow immediately, later, or never 2071 again. These semantics are carried in the MP_TCPRST option that can 2072 be included on a TCP RST packet. 2074 1 2 3 2075 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2076 +---------------+---------------+-------+-----------------------+ 2077 | Kind | Length |Subtype|U|V|W|T| Reason | 2078 +---------------+---------------+-------+-----------------------+ 2080 Figure 15: TCP RST Reason (MP_TCPRST) Option 2082 The MP_TCPRST option contains a reason code that allows the sender of 2083 the option to provide more information about the reason for the 2084 termination of the subflow. Using 12 bits of option space, the first 2085 four bits are reserved for flags (only one of which is currently 2086 defined), and the remaining octet is used to express a reason code 2087 for this subflow termination, from which a receiver MAY infer 2088 information about the usability of this path. 2090 The "T" flag is used by the sender to indicate whether the error 2091 condition that is reported is Transient (T bit set to 1) or Permanent 2092 (T bit set to 0). If the error condition is considered to be 2093 Transient by the sender of the RST segment, the recipient of this 2094 segment MAY try to reestablish a subflow for this connection over the 2095 failed path. The time at which a receiver may try to re-establish 2096 this is implementation-specific, but SHOULD take into account the 2097 properties of the failure defined by the following reason code. If 2098 the error condition is considered to be permanent, the receiver of 2099 the RST segment SHOULD NOT try to reestablish a subflow for this 2100 connection over this path. The "U", "V" and "W" flags are not 2101 defined by this specification and are reserved for future use. 2103 The "Reason" code is an 8-bit field that indicates the reason for the 2104 termination of the subflow. The following codes are defined in this 2105 document: 2107 o Unspecified error (code 0x0). This is the default error implying 2108 the subflow is not longer available. The receiving host SHOULD 2109 take account of the 'T' bit in deciding whether to re-estbalish 2110 this subflow. The presence of this option shows that the RST was 2111 generated by a MPTCP-aware device. 2113 o MPTCP specific error (code 0x01). An error has been detected in 2114 the processing of MPTCP options. This is the usual reason code to 2115 return in the cases where a RST is being sent to close a subflow 2116 for reasons of an invalid response. 2118 o Lack of resources (code 0x02). This code indicates that the 2119 sending host does not have enough ressources to support the 2120 terminated subflow. 2122 o Administratively prohibited (code 0x03). This code indicates that 2123 the requested subflow is prohibited by the policies of the sending 2124 host. 2126 o Too much outstanding data (code 0x04). This code indicates that 2127 there is an excessive amount of data that need to be transmitted 2128 over the terminated subflow while having already been acknowledged 2129 over one or more other subflows. This may occur if a path has 2130 been unavailable for a short period and it is more efficient to 2131 reset and start again than it is to retransmit the queued data. 2133 o Unacceptable performance (code 0x05). This code indicates that 2134 the performance of this subflow was too low compared to the other 2135 subflows of this Multipath TCP connection. 2137 o Middlebox interference (code 0x06). Middlebox interference has 2138 been detected over this subflow making MPTCP signaling invalid. 2139 For example, this may be sent if the checksum does not validate. 2141 3.7. MPTCP Experimental Option 2143 In order to provide a structured identity and negotiation mechanism 2144 for private experimental MPTCP extensions, the MP_EXPERIMENTAL option 2145 has been reserved. 2147 1 2 3 2148 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2149 +---------------+---------------+-------+-------+---------------+ 2150 | Kind | Length |Subtype|S|U|rsv| Experiment | 2151 +---------------+---------------+-------+-------+---------------+ 2152 | Id. (16 bits) | Subtype-specific data (variable length) ... 2153 +----------------------------------------------------------- ... 2155 Figure 16: MPTCP Experimental (MP_EXPERIMENTAL) Option 2157 Figure 16 shows the format of the experimental option. The 2158 Experiment identifier is a 16 bits integer that shall be assigned by 2159 using the same procedure as defined in [RFC6994]; a request to IANA 2160 is made in Section 8.4. 2162 The two high order flags that are included in the MPTCP Experimental 2163 option have the following semantics: 2165 o "S" flag (highest order bit) : This is the synchronising bit. 2166 When set to 1, it indicates that the host sending this option 2167 expects a reply from the remote host with an option having the 2168 same experiment identifier, but possibly containing other data. 2170 o "U" flag (second highest order bit) : When set to 1, this flag 2171 indicates that the experimental option was received by the sending 2172 host but it was unable to parse it. 2174 The two low order flags are currently reserved for further use. They 2175 MUST be set to zero when sending and ignored upon reception. 2177 To use the Experimental MPTCP option with a given experiment 2178 identifier over a MPTCP connection, the sending host must first 2179 verify the ability of the remote host to support this particular 2180 Experimental option. For this, it first sends in any valid TCP 2181 segment, including a duplicate acknowledgement, an Experimental MPTCP 2182 option with the "S" flag set. Upon reception of this option, the 2183 receiving host will verify whether it supports it. If yes, it shall 2184 return a TCP segment that contains the experimental option with the 2185 same identifier and the "S" and the "U" flags both set to 1. This 2186 option may contain additional data depending on the semantics of the 2187 extension. If the receiving host does not recognise the experimental 2188 option that it has received, it shall return a TCP segment that 2189 contains the received experimental option with the "S" flag set to 0 2190 and the "U" flag set to 1. 2192 If a host receives an Experimental MPTCP option with the "U" flag set 2193 to 0 which it does not support, or which contains information that 2194 the host cannot parse, it shall return the exact option that it 2195 received with the "U" flag set to 1 to indicate the error to the 2196 remote host. If an invalid option is received with the "U" flag set 2197 to 0, it must be silently discarded. 2199 Future documents specifying new experimental MPTCP options should 2200 specify the extract semantic of the Subtype-specific data and whether 2201 additional validation operations are to be followed at both sides. 2202 It should be noted that data can be included in an experimental 2203 option concurrently with the capability check (S/U). 2205 3.8. Fallback 2207 Sometimes, middleboxes will exist on a path that could prevent the 2208 operation of MPTCP. MPTCP has been designed in order to cope with 2209 many middlebox modifications (see Section 6), but there are still 2210 some cases where a subflow could fail to operate within the MPTCP 2211 requirements. These cases are notably the following: the loss of 2212 MPTCP options on a path and the modification of payload data. If 2213 such an event occurs, it is necessary to "fall back" to the previous, 2214 safe operation. This may be either falling back to regular TCP or 2215 removing a problematic subflow. 2217 At the start of an MPTCP connection (i.e., the first subflow), it is 2218 important to ensure that the path is fully MPTCP capable and the 2219 necessary MPTCP options can reach each host. The handshake as 2220 described in Section 3.1 SHOULD fall back to regular TCP if either of 2221 the SYN messages do not have the MPTCP options: this is the same, and 2222 desired, behavior in the case where a host is not MPTCP capable, or 2223 the path does not support the MPTCP options. When attempting to join 2224 an existing MPTCP connection (Section 3.2), if a path is not MPTCP 2225 capable and the MPTCP options do not get through on the SYNs, the 2226 subflow will be closed according to the MP_JOIN logic. 2228 There is, however, another corner case that should be addressed. 2229 That is one of MPTCP options getting through on the SYN, but not on 2230 regular packets. This can be resolved if the subflow is the first 2231 subflow, and thus all data in flight is contiguous, using the 2232 following rules. 2234 A sender MUST include a DSS option with data sequence mapping in 2235 every segment until one of the sent segments has been acknowledged 2236 with a DSS option containing a Data ACK. Upon reception of the 2237 acknowledgment, the sender has the confirmation that the DSS option 2238 passes in both directions and may choose to send fewer DSS options 2239 than once per segment. 2241 If, however, an ACK is received for data (not just for the SYN) 2242 without a DSS option containing a Data ACK, the sender determines the 2243 path is not MPTCP capable. In the case of this occurring on an 2244 additional subflow (i.e., one started with MP_JOIN), the host MUST 2245 close the subflow with a RST. In the case of the first subflow 2246 (i.e., that started with MP_CAPABLE), it MUST drop out of an MPTCP 2247 mode back to regular TCP. The sender will send one final data 2248 sequence mapping, with the Data-Level Length value of 0 indicating an 2249 infinite mapping (in case the path drops options in one direction 2250 only), and then revert to sending data on the single subflow without 2251 any MPTCP options. 2253 Note that this rule essentially prohibits the sending of data on the 2254 third packet of an MP_CAPABLE or MP_JOIN handshake, since both that 2255 option and a DSS cannot fit in TCP option space. If the initiator is 2256 to send first, another segment must be sent that contains the data 2257 and DSS. Note also that an additional subflow cannot be used until 2258 the initial path has been verified as MPTCP capable. 2260 If a subflow breaks during operation, e.g. if it is re-routed and 2261 MPTCP options are no longer permitted, then once this is detected (by 2262 the subflow-level receive buffer filling up), the subflow SHOULD be 2263 treated as broken and closed with a RST, since no data can be 2264 delivered to the application layer, and no fallback signal can be 2265 reliably sent. This RST SHOULD include the MP_TCPRST option 2266 (Section 3.6) with an appropriate reason code. 2268 These rules should cover all cases where such a failure could happen: 2269 whether it's on the forward or reverse path and whether the server or 2270 the client first sends data. If lost options on data packets occur 2271 on any other subflow apart from the initial subflow, it should be 2272 treated as a standard path failure. The data would not be DATA_ACKed 2273 (since there is no mapping for the data), and the subflow can be 2274 closed with a RST, containing a MP_TCPRST option (Section 3.6) with 2275 an appropriate reason code. 2277 The case described above is a specialized case of fallback, for when 2278 the lack of MPTCP support is detected before any data is acknowledged 2279 at the connection level on a subflow. More generally, fallback 2280 (either closing a subflow, or to regular TCP) can become necessary at 2281 any point during a connection if a non-MPTCP-aware middlebox changes 2282 the data stream. 2284 As described in Section 3.3, each portion of data for which there is 2285 a mapping is protected by a checksum, if checksums have been 2286 negotiated. This mechanism is used to detect if middleboxes have 2287 made any adjustments to the payload (added, removed, or changed 2288 data). A checksum will fail if the data has been changed in any way. 2289 This will also detect if the length of data on the subflow is 2290 increased or decreased, and this means the data sequence mapping is 2291 no longer valid. The sender no longer knows what subflow-level 2292 sequence number the receiver is genuinely operating at (the middlebox 2293 will be faking ACKs in return), and it cannot signal any further 2294 mappings. Furthermore, in addition to the possibility of payload 2295 modifications that are valid at the application layer, there is the 2296 possibility that false positives could be hit across MPTCP segment 2297 boundaries, corrupting the data. Therefore, all data from the start 2298 of the segment that failed the checksum onwards is not trustworthy. 2300 Note that if checksum usage has not been negotiated, this fallback 2301 mechanism cannot be used unless there is some higher or lower layer 2302 signal to inform the MPTCP implementation that the payload has been 2303 tampered with. 2305 When multiple subflows are in use, the data in flight on a subflow 2306 will likely involve data that is not contiguously part of the 2307 connection-level stream, since segments will be spread across the 2308 multiple subflows. Due to the problems identified above, it is not 2309 possible to determine what the adjustment has done to the data 2310 (notably, any changes to the subflow sequence numbering). Therefore, 2311 it is not possible to recover the subflow, and the affected subflow 2312 must be immediately closed with a RST, featuring an MP_FAIL option 2313 (Figure 17), which defines the data sequence number at the start of 2314 the segment (defined by the data sequence mapping) that had the 2315 checksum failure. Note that the MP_FAIL option requires the use of 2316 the full 64-bit sequence number, even if 32-bit sequence numbers are 2317 normally in use in the DSS signals on the path. 2319 1 2 3 2320 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2321 +---------------+---------------+-------+----------------------+ 2322 | Kind | Length=12 |Subtype| (reserved) | 2323 +---------------+---------------+-------+----------------------+ 2324 | | 2325 | Data Sequence Number (8 octets) | 2326 | | 2327 +--------------------------------------------------------------+ 2329 Figure 17: Fallback (MP_FAIL) Option 2331 The receiver MUST discard all data following the data sequence number 2332 specified. Failed data MUST NOT be DATA_ACKed and so will be 2333 retransmitted on other subflows (Section 3.3.6). 2335 A special case is when there is a single subflow and it fails with a 2336 checksum error. If it is known that all unacknowledged data in 2337 flight is contiguous (which will usually be the case with a single 2338 subflow), an infinite mapping can be applied to the subflow without 2339 the need to close it first, and essentially turn off all further 2340 MPTCP signaling. In this case, if a receiver identifies a checksum 2341 failure when there is only one path, it will send back an MP_FAIL 2342 option on the subflow-level ACK, referring to the data-level sequence 2343 number of the start of the segment on which the checksum error was 2344 detected. The sender will receive this, and if all unacknowledged 2345 data in flight is contiguous, will signal an infinite mapping. This 2346 infinite mapping will be a DSS option (Section 3.3) on the first new 2347 packet, containing a data sequence mapping that acts retroactively, 2348 referring to the start of the subflow sequence number of the most 2349 recent segment that was known to be delivered intact (i.e. was 2350 successfully DATA_ACKed). From that point onwards, data can be 2351 altered by a middlebox without affecting MPTCP, as the data stream is 2352 equivalent to a regular, legacy TCP session. The MP_FAIL signal 2353 affects only one direction of traffic. It is not mandatory for the 2354 reciever of an MP_FAIL to also respond with an MP_FAIL, since the 2355 paths may only be damaged in one direction. However, implementations 2356 MAY choose to send a MP_FAIL in the reverse direction and entirely 2357 revert to a regular TCP session. 2359 In the rare case that the data is not contiguous (which could happen 2360 when there is only one subflow but it is retransmitting data from a 2361 subflow that has recently been uncleanly closed), the receiver MUST 2362 close the subflow with a RST with MP_FAIL. The receiver MUST discard 2363 all data that follows the data sequence number specified. The sender 2364 MAY attempt to create a new subflow belonging to the same connection, 2365 and, if it chooses to do so, SHOULD place the single subflow 2366 immediately in single-path mode by setting an infinite data sequence 2367 mapping. This mapping will begin from the data-level sequence number 2368 that was declared in the MP_FAIL. 2370 After a sender signals an infinite mapping, it MUST only use subflow 2371 ACKs to clear its send buffer. This is because Data ACKs may become 2372 misaligned with the subflow ACKs when middleboxes insert or delete 2373 data. The receive SHOULD stop generating Data ACKs after it receives 2374 an infinite mapping. 2376 When a connection has fallen back, only one subflow can send data; 2377 otherwise, the receiver would not know how to reorder the data. In 2378 practice, this means that all MPTCP subflows will have to be 2379 terminated except one. Once MPTCP falls back to regular TCP, it MUST 2380 NOT revert to MPTCP later in the connection. 2382 It should be emphasized that we are not attempting to prevent the use 2383 of middleboxes that want to adjust the payload. An MPTCP-aware 2384 middlebox could provide such functionality by also rewriting 2385 checksums. 2387 3.9. Error Handling 2389 In addition to the fallback mechanism as described above, the 2390 standard classes of TCP errors may need to be handled in an MPTCP- 2391 specific way. Note that changing semantics -- such as the relevance 2392 of a RST -- are covered in Section 4. Where possible, we do not want 2393 to deviate from regular TCP behavior. 2395 The following list covers possible errors and the appropriate MPTCP 2396 behavior: 2398 o Unknown token in MP_JOIN (or HMAC failure in MP_JOIN ACK, or 2399 missing MP_JOIN in SYN/ACK response): send RST (analogous to TCP's 2400 behavior on an unknown port) 2402 o DSN out of window (during normal operation): drop the data, do not 2403 send Data ACKs 2405 o Remove request for unknown address ID: silently ignore 2407 3.10. Heuristics 2409 There are a number of heuristics that are needed for performance or 2410 deployment but that are not required for protocol correctness. In 2411 this section, we detail such heuristics. Note that discussion of 2412 buffering and certain sender and receiver window behaviors are 2413 presented in Sections 3.3.4 and 3.3.5, as well as retransmission in 2414 Section 3.3.6. 2416 3.10.1. Port Usage 2418 Under typical operation, an MPTCP implementation SHOULD use the same 2419 ports as already in use. In other words, the destination port of a 2420 SYN containing an MP_JOIN option SHOULD be the same as the remote 2421 port of the first subflow in the connection. The local port for such 2422 SYNs SHOULD also be the same as for the first subflow (and as such, 2423 an implementation SHOULD reserve ephemeral ports across all local IP 2424 addresses), although there may be cases where this is infeasible. 2425 This strategy is intended to maximize the probability of the SYN 2426 being permitted by a firewall or NAT at the recipient and to avoid 2427 confusing any network monitoring software. 2429 There may also be cases, however, where the passive opener wishes to 2430 signal to the other host that a specific port should be used, and 2431 this facility is provided in the Add Address option as documented in 2432 Section 3.4.1. It is therefore feasible to allow multiple subflows 2433 between the same two addresses but using different port pairs, and 2434 such a facility could be used to allow load balancing within the 2435 network based on 5-tuples (e.g., some ECMP implementations 2436 [RFC2992]). 2438 3.10.2. Delayed Subflow Start and Subflow Symmetry 2440 Many TCP connections are short-lived and consist only of a few 2441 segments, and so the overheads of using MPTCP outweigh any benefits. 2442 A heuristic is required, therefore, to decide when to start using 2443 additional subflows in an MPTCP connection. We expect that 2444 experience gathered from deployments will provide further guidance on 2445 this, and will be affected by particular application characteristics 2446 (which are likely to change over time). However, a suggested 2447 general-purpose heuristic that an implementation MAY choose to employ 2448 is as follows. Results from experimental deployments are needed in 2449 order to verify the correctness of this proposal. 2451 If a host has data buffered for its peer (which implies that the 2452 application has received a request for data), the host opens one 2453 subflow for each initial window's worth of data that is buffered. 2455 Consideration should also be given to limiting the rate of adding new 2456 subflows, as well as limiting the total number of subflows open for a 2457 particular connection. A host may choose to vary these values based 2458 on its load or knowledge of traffic and path characteristics. 2460 Note that this heuristic alone is probably insufficient. Traffic for 2461 many common applications, such as downloads, is highly asymmetric and 2462 the host that is multihomed may well be the client that will never 2463 fill its buffers, and thus never use MPTCP. Advanced APIs that allow 2464 an application to signal its traffic requirements would aid in these 2465 decisions. 2467 An additional time-based heuristic could be applied, opening 2468 additional subflows after a given period of time has passed. This 2469 would alleviate the above issue, and also provide resilience for low- 2470 bandwidth but long-lived applications. 2472 If the two communicating hosts immediately try to set up subflows 2473 from all available addresses to all available addresses on the other 2474 host, this could end up creating two subflows per path. This is an 2475 inefficient use of resources. 2477 If the the same ports are used on all subflows, as recommended above, 2478 then standard TCP simultaneous open logic should take care of this 2479 situation and only one subflow will be established between the 2480 address pairs. However, this relies on the same ports being used at 2481 both end hosts. If a host does not support TCP simultaneous open, it 2482 is RECOMMENDED that some element of randomization is applied to the 2483 time waited before opening new subflows, so that only one subflow 2484 exists between a given address pair. If, however, hosts signal 2485 additional ports to use (for example, for leveraging ECMP on-path), 2486 this heuristic need not apply. 2488 This section has shown some of the considerations that an implementer 2489 should give when developing MPTCP heuristics, but is not intended to 2490 be prescriptive. 2492 3.10.3. Failure Handling 2494 Requirements for MPTCP's handling of unexpected signals have been 2495 given in Section 3.9. There are other failure cases, however, where 2496 a hosts can choose appropriate behavior. 2498 For example, Section 3.1 suggests that a host SHOULD fall back to 2499 trying regular TCP SYNs after one or more failures of MPTCP SYNs for 2500 a connection. A host may keep a system-wide cache of such 2501 information, so that it can back off from using MPTCP, firstly for 2502 that particular destination host, and eventually on a whole 2503 interface, if MPTCP connections continue failing. 2505 Another failure could occur when the MP_JOIN handshake fails. 2506 Section 3.9 specifies that an incorrect handshake MUST lead to the 2507 subflow being closed with a RST. A host operating an active 2508 intrusion detection system may choose to start blocking MP_JOIN 2509 packets from the source host if multiple failed MP_JOIN attempts are 2510 seen. From the connection initiator's point of view, if an MP_JOIN 2511 fails, it SHOULD NOT attempt to connect to the same IP address and 2512 port during the lifetime of the connection, unless the other host 2513 refreshes the information with another ADD_ADDR option. Note that 2514 the ADD_ADDR option is informational only, and does not guarantee the 2515 other host will attempt a connection. 2517 In addition, an implementation may learn, over a number of 2518 connections, that certain interfaces or destination addresses 2519 consistently fail and may default to not trying to use MPTCP for 2520 these. Behavior could also be learned for particularly badly 2521 performing subflows or subflows that regularly fail during use, in 2522 order to temporarily choose not to use these paths. 2524 3.11. TCP Fast Open 2526 TCP Fast Open, described in [RFC7413], has been introduced with the 2527 objective of gaining one RTT before transmitting data. This is 2528 considered a valuable gain as very short connections are very common, 2529 especially for HTTP request/response schemes. It achieves this by 2530 sending the SYN-segment together with data and allowing the server to 2531 reply immediately with data after the SYN/ACK. [RFC7413] secures 2532 this mechanism, by using a new TCP option that includes a cookie 2533 which is negotiated in a preceding connection. 2535 When using TCP Fast Open in conjunction with MPTCP, there are two key 2536 points to take into account, detailed hereafter. 2538 3.11.1. TFO cookie request with MPTCP 2540 When a TFO client first connects to a server, it cannot immediately 2541 include data in the SYN for security reasons [RFC7413]. Instead, it 2542 requests a cookie that will be used in subsequent connections. This 2543 is done with the TCP cookie request/response options, of resp. 2 2544 bytes and 6-18 bytes (depending on the chosen cookie length). 2546 TFO and MPTCP can be combined provided that the total length of their 2547 options does not exceed the maximum 40 bytes possible in TCP: 2549 o In the SYN: MPTCP uses a 4-bytes long MP_CAPABLE option. The 2550 MPTCP and TFO options sum up to 6 bytes. With typical TCP-options 2551 using up to 19 bytes in the SYN (24 bytes if options are padded at 2552 a word boundary), there is enough space to combine the MP_CAPABLE 2553 with the TFO Cookie Request. 2555 o In the SYN+ACK: MPTCP uses a 12-bytes long MP_CAPABLE option, but 2556 now TFO can be as long as 18 bytes. Since the maximum option 2557 length may be exceeded, it is up to the server to solve this by 2558 using a shorter cookie. As an example, if we consider that 19 2559 bytes are used for classical TCP options, the maximum possible 2560 cookie length would be of 7 bytes. Note that the same limitation 2561 applies to subsequent connections, for the SYN packet (because the 2562 client then echoes back the cookie to the server). Finally, if 2563 the security impact of reducing the cookie size is not deemed 2564 acceptable, the server can reduce the amount of other TCP-options 2565 by omitting the TCP timestamps (as outlined in Appendix A). 2567 3.11.2. Data sequence mapping under TFO 2569 MPTCP uses, in the TCP establishment phase, a key exchange that is 2570 used to generate the Initial Data Sequence Numbers (IDSNs). In 2571 particular, the SYN with MP_CAPABLE occupies the first octet of the 2572 data sequence space. With TFO, one way to handle the data sent 2573 together with the SYN would be to consider an implicit DSS mapping 2574 that covers that SYN segment (since there is not enough space in the 2575 SYN to include a DSS option). The problem with that approach is that 2576 if a middlebox modifies the TFO data, this will not be noticed by 2577 MPTCP because of the absence of a DSS-checksum. For example, a TCP 2578 (but not MPTCP)-aware middlebox could insert bytes at the beginning 2579 of the stream and adapt the TCP checksum and sequence numbers 2580 accordingly. With an implicit mapping, this would give to client and 2581 server a different view on the DSS-mapping, with no way to detect 2582 this inconsistency as the DSS checksum is not present. 2584 To solve this, the TFO data should not be considered part of the Data 2585 Sequence Number space: the SYN with MP_CAPABLE still occupies the 2586 first octet of data sequence space, but then the first non-TFO data 2587 byte occupies the second octet. This guarantees that, if the use of 2588 DSS-checksum is negotiated, all data in the data sequence number 2589 space is checksummed. We also note that this does not entail a loss 2590 of functionality, because TFO-data is always sent when only one path 2591 is active. 2593 3.11.3. Connection establishment examples 2595 The following shows a few examples of possible TFO+MPTCP 2596 establishment scenarios. 2598 Before a client can send data together with the SYN, it must request 2599 a cookie to the server, as shown in Figure Figure 18. This is done 2600 by simply combining the TFO and MPTCP options. 2602 client server 2603 | | 2604 | S 0(0) , | 2605 | -----------------------------------------------------------> | 2606 | | 2607 | S. 0(0) ack 1 , | 2608 | <----------------------------------------------------------- | 2609 | | 2610 | . 0(0) ack 1 | 2611 | -----------------------------------------------------------> | 2612 | | 2614 Figure 18: Cookie request 2616 Once this is done, the received cookie can be used for TFO, as shown 2617 in Figure Figure 19. In this example, the client first sends 20 2618 bytes in the SYN. The server immediately replies with 100 bytes 2619 following the SYN-ACK upon which the client replies with 20 more 2620 bytes. Note that the last segment in the figure has a TCP sequence 2621 number of 21, while the DSS subflow sequence number is 1 (because the 2622 TFO data is not part of the data sequence number space, as explained 2623 in Section Section 3.11.2. 2625 client server 2626 | | 2627 | S 0(20) , | 2628 | -----------------------------------------------------------> | 2629 | | 2630 | S. 0(0) ack 21 | 2631 | <----------------------------------------------------------- | 2632 | | 2633 | . 1(100) ack 21 | 2634 | <----------------------------------------------------------- | 2635 | | 2636 | . 21(0) ack 1 | 2637 | -----------------------------------------------------------> | 2638 | | 2639 | . 21(20) ack 101 | 2640 | -----------------------------------------------------------> | 2641 | | 2643 Figure 19: The server supports TFO 2645 In Figure Figure 20, the server does not support TFO. The client 2646 detects that no state is created in the server (as no data is acked), 2647 and now sends the MP_CAPABLE in the third ack, in order for the 2648 server to build its MPTCP context at then end of the establishment. 2649 Now, the tfo data, retransmitted, becomes part of the data sequence 2650 mapping because it is effectively sent (in fact re-sent) after the 2651 establishment. 2653 client server 2654 | | 2655 | S 0(20) , | 2656 | -----------------------------------------------------------> | 2657 | | 2658 | S. 0(0) ack 1 | 2659 | <----------------------------------------------------------- | 2660 | | 2661 | . 1(0) ack 1 | 2662 | -----------------------------------------------------------> | 2663 | | 2664 | . 1(20) ack 1 | 2665 | -----------------------------------------------------------> | 2666 | | 2667 | . 0(0) ack 21 | 2668 | <----------------------------------------------------------- | 2669 | | 2671 Figure 20: The server does not support TFO 2673 It is also possible that the server acknowledges only part of the TFO 2674 data, as illustrated in Figure Figure 21. The client will simply 2675 retransmit the missing data together with a DSS-mapping. 2677 client server 2678 | | 2679 | S 0(1000) , | 2680 | -----------------------------------------------------------> | 2681 | | 2682 | S. 0(0) ack 501 | 2683 | <----------------------------------------------------------- | 2684 | | 2685 | . 501(0) ack 1 | 2686 | -----------------------------------------------------------> | 2687 | | 2688 | . 501(500) ack 1 | 2689 | -----------------------------------------------------------> | 2690 | | 2692 Figure 21: Partial data acknowledgement 2694 4. Semantic Issues 2696 In order to support multipath operation, the semantics of some TCP 2697 components have changed. To aid clarity, this section collects these 2698 semantic changes as a reference. 2700 Sequence number: The (in-header) TCP sequence number is specific to 2701 the subflow. To allow the receiver to reorder application data, 2702 an additional data-level sequence space is used. In this data- 2703 level sequence space, the initial SYN and the final DATA_FIN 2704 occupy 1 octet of sequence space. There is an explicit mapping of 2705 data sequence space to subflow sequence space, which is signaled 2706 through TCP options in data packets. 2708 ACK: The ACK field in the TCP header acknowledges only the subflow 2709 sequence number, not the data-level sequence space. 2710 Implementations SHOULD NOT attempt to infer a data-level 2711 acknowledgment from the subflow ACKs. This separates subflow- and 2712 connection-level processing at an end host. 2714 Duplicate ACK: A duplicate ACK that includes any MPTCP signaling 2715 (with the exception of the DSS option) MUST NOT be treated as a 2716 signal of congestion. To limit the chances of non-MPTCP-aware 2717 entities mistakenly interpreting duplicate ACKs as a signal of 2718 congestion, MPTCP SHOULD NOT send more than two duplicate ACKs 2719 containing (non-DSS) MPTCP signals in a row. 2721 Receive Window: The receive window in the TCP header indicates the 2722 amount of free buffer space for the whole data-level connection 2723 (as opposed to for this subflow) that is available at the 2724 receiver. This is the same semantics as regular TCP, but to 2725 maintain these semantics the receive window must be interpreted at 2726 the sender as relative to the sequence number given in the 2727 DATA_ACK rather than the subflow ACK in the TCP header. In this 2728 way, the original flow control role is preserved. Note that some 2729 middleboxes may change the receive window, and so a host SHOULD 2730 use the maximum value of those recently seen on the constituent 2731 subflows for the connection-level receive window, and also needs 2732 to maintain a subflow-level window for subflow-level processing. 2734 FIN: The FIN flag in the TCP header applies only to the subflow it 2735 is sent on, not to the whole connection. For connection-level FIN 2736 semantics, the DATA_FIN option is used. 2738 RST: The RST flag in the TCP header applies only to the subflow it 2739 is sent on, not to the whole connection. The MP_FASTCLOSE option 2740 provides the fast close functionality of a RST at the MPTCP 2741 connection level. 2743 Address List: Address list management (i.e., knowledge of the local 2744 and remote hosts' lists of available IP addresses) is handled on a 2745 per-connection basis (as opposed to per subflow, per host, or per 2746 pair of communicating hosts). This permits the application of 2747 per-connection local policy. Adding an address to one connection 2748 (either explicitly through an Add Address message, or implicitly 2749 through a Join) has no implication for other connections between 2750 the same pair of hosts. 2752 5-tuple: The 5-tuple (protocol, local address, local port, remote 2753 address, remote port) presented by kernel APIs to the application 2754 layer in a non-multipath-aware application is that of the first 2755 subflow, even if the subflow has since been closed and removed 2756 from the connection. This decision, and other related API issues, 2757 are discussed in more detail in [RFC6897]. 2759 5. Security Considerations 2761 As identified in [RFC6181], the addition of multipath capability to 2762 TCP will bring with it a number of new classes of threat. In order 2763 to prevent these, [RFC6182] presents a set of requirements for a 2764 security solution for MPTCP. The fundamental goal is for the 2765 security of MPTCP to be "no worse" than regular TCP today, and the 2766 key security requirements are: 2768 o Provide a mechanism to confirm that the parties in a subflow 2769 handshake are the same as in the original connection setup. 2771 o Provide verification that the peer can receive traffic at a new 2772 address before using it as part of a connection. 2774 o Provide replay protection, i.e., ensure that a request to add/ 2775 remove a subflow is 'fresh'. 2777 In order to achieve these goals, MPTCP includes a hash-based 2778 handshake algorithm documented in Sections 3.1 and 3.2. 2780 The security of the MPTCP connection hangs on the use of keys that 2781 are shared once at the start of the first subflow, and are never sent 2782 again over the network (unless used in the fast close mechanism, 2783 Section 3.5). To ease demultiplexing while not giving away any 2784 cryptographic material, future subflows use a truncated cryptographic 2785 hash of this key as the connection identification "token". The keys 2786 are concatenated and used as keys for creating Hash-based Message 2787 Authentication Codes (HMACs) used on subflow setup, in order to 2788 verify that the parties in the handshake are the same as in the 2789 original connection setup. It also provides verification that the 2790 peer can receive traffic at this new address. Replay attacks would 2791 still be possible when only keys are used; therefore, the handshakes 2792 use single-use random numbers (nonces) at both ends -- this ensures 2793 the HMAC will never be the same on two handshakes. Guidance on 2794 generating random numbers suitable for use as keys is given in 2795 [RFC4086] and discussed in Section 3.1. 2797 The use of crypto capability bits in the initial connection handshake 2798 to negotiate use of a particular algorithm allows the deployment of 2799 additional crypto mechanisms in the future. Note that this would be 2800 susceptible to bid-down attacks only if the attacker was on-path (and 2801 thus would be able to modify the data anyway). The security 2802 mechanism presented in this document should therefore protect against 2803 all forms of flooding and hijacking attacks discussed in [RFC6181]. 2805 During normal operation, regular TCP protection mechanisms (such as 2806 ensuring sequence numbers are in-window) will provide the same level 2807 of protection against attacks on individual TCP subflows as exists 2808 for regular TCP today. Implementations will introduce additional 2809 buffers compared to regular TCP, to reassemble data at the connection 2810 level. The application of window sizing will minimize the risk of 2811 denial-of-service attacks consuming resources. 2813 As discussed in Section 3.4.1, a host may advertise its private 2814 addresses, but these might point to different hosts in the receiver's 2815 network. The MP_JOIN handshake (Section 3.2) will ensure that this 2816 does not succeed in setting up a subflow to the incorrect host. 2817 However, it could still create unwanted TCP handshake traffic. This 2818 feature of MPTCP could be a target for denial-of-service exploits, 2819 with malicious participants in MPTCP connections encouraging the 2820 recipient to target other hosts in the network. Therefore, 2821 implementations should consider heuristics (Section 3.10) at both the 2822 sender and receiver to reduce the impact of this. 2824 A small security risk could theoretically exist with key reuse, but 2825 in order to accomplish a replay attack, both the sender and receiver 2826 keys, and the sender and receiver random numbers, in the MP_JOIN 2827 handshake (Section 3.2) would have to match. 2829 Whilst this specification defines a "medium" security solution, 2830 meeting the criteria specified at the start of this section and the 2831 threat analysis ([RFC6181]), since attacks only ever get worse, it is 2832 likely that a future Standards Track version of MPTCP would need to 2833 be able to support stronger security. There are several ways the 2834 security of MPTCP could potentially be improved; some of these would 2835 be compatible with MPTCP as defined in this document, whilst others 2836 may not be. For now, the best approach is to get experience with the 2837 current approach, establish what might work, and check that the 2838 threat analysis is still accurate. 2840 Possible ways of improving MPTCP security could include: 2842 o defining a new MPCTP cryptographic algorithm, as negotiated in 2843 MP_CAPABLE. A sub-case could be to include an additional 2844 deployment assumption, such as stateful servers, in order to allow 2845 a more powerful algorithm to be used. 2847 o defining how to secure data transfer with MPTCP, whilst not 2848 changing the signaling part of the protocol. 2850 o defining security that requires more option space, perhaps in 2851 conjunction with a "long options" proposal for extending the TCP 2852 options space (such as those surveyed in [TCPLO]), or perhaps 2853 building on the current approach with a second stage of MPTCP- 2854 option-based security. 2856 o revisiting the working group's decision to exclusively use TCP 2857 options for MPTCP signaling, and instead look at also making use 2858 of the TCP payloads. 2860 MPTCP has been designed with several methods available to indicate a 2861 new security mechanism, including: 2863 o available flags in MP_CAPABLE (Figure 4); 2864 o available subtypes in the MPTCP option (Figure 3); 2866 o the version field in MP_CAPABLE (Figure 4); 2868 6. Interactions with Middleboxes 2870 Multipath TCP was designed to be deployable in the present world. 2871 Its design takes into account "reasonable" existing middlebox 2872 behavior. In this section, we outline a few representative 2873 middlebox-related failure scenarios and show how Multipath TCP 2874 handles them. Next, we list the design decisions multipath has made 2875 to accommodate the different middleboxes. 2877 A primary concern is our use of a new TCP option. Middleboxes should 2878 forward packets with unknown options unchanged, yet there are some 2879 that don't. These we expect will either strip options and pass the 2880 data, drop packets with new options, copy the same option into 2881 multiple segments (e.g., when doing segmentation), or drop options 2882 during segment coalescing. 2884 MPTCP uses a single new TCP option "Kind", and all message types are 2885 defined by "subtype" values (see Section 8). This should reduce the 2886 chances of only some types of MPTCP options being passed, and instead 2887 the key differing characteristics are different paths, and the 2888 presence of the SYN flag. 2890 MPTCP SYN packets on the first subflow of a connection contain the 2891 MP_CAPABLE option (Section 3.1). If this is dropped, MPTCP SHOULD 2892 fall back to regular TCP. If packets with the MP_JOIN option 2893 (Section 3.2) are dropped, the paths will simply not be used. 2895 If a middlebox strips options but otherwise passes the packets 2896 unchanged, MPTCP will behave safely. If an MP_CAPABLE option is 2897 dropped on either the outgoing or the return path, the initiating 2898 host can fall back to regular TCP, as illustrated in Figure 22 and 2899 discussed in Section 3.1. 2901 Subflow SYNs contain the MP_JOIN option. If this option is stripped 2902 on the outgoing path, the SYN will appear to be a regular SYN to Host 2903 B. Depending on whether there is a listening socket on the target 2904 port, Host B will reply either with SYN/ACK or RST (subflow 2905 connection fails). When Host A receives the SYN/ACK it sends a RST 2906 because the SYN/ACK does not contain the MP_JOIN option and its 2907 token. Either way, the subflow setup fails, but otherwise does not 2908 affect the MPTCP connection as a whole. 2910 Host A Host B 2911 | Middlebox M | 2912 | | | 2913 | SYN(MP_CAPABLE) | SYN | 2914 |-------------------|---------------->| 2915 | SYN/ACK | 2916 |<------------------------------------| 2917 a) MP_CAPABLE option stripped on outgoing path 2919 Host A Host B 2920 | SYN(MP_CAPABLE) | 2921 |------------------------------------>| 2922 | Middlebox M | 2923 | | | 2924 | SYN/ACK |SYN/ACK(MP_CAPABLE)| 2925 |<----------------|-------------------| 2926 b) MP_CAPABLE option stripped on return path 2928 Figure 22: Connection Setup with Middleboxes that Strip Options from 2929 Packets 2931 We now examine data flow with MPTCP, assuming the flow is correctly 2932 set up, which implies the options in the SYN packets were allowed 2933 through by the relevant middleboxes. If options are allowed through 2934 and there is no resegmentation or coalescing to TCP segments, 2935 Multipath TCP flows can proceed without problems. 2937 The case when options get stripped on data packets has been discussed 2938 in the Fallback section. If a fraction of options are stripped, 2939 behavior is not deterministic. If some data sequence mappings are 2940 lost, the connection can continue so long as mappings exist for the 2941 subflow-level data (e.g., if multiple maps have been sent that 2942 reinforce each other). If some subflow-level space is left unmapped, 2943 however, the subflow is treated as broken and is closed, through the 2944 process described in Section 3.8. MPTCP should survive with a loss 2945 of some Data ACKs, but performance will degrade as the fraction of 2946 stripped options increases. We do not expect such cases to appear in 2947 practice, though: most middleboxes will either strip all options or 2948 let them all through. 2950 We end this section with a list of middlebox classes, their behavior, 2951 and the elements in the MPTCP design that allow operation through 2952 such middleboxes. Issues surrounding dropping packets with options 2953 or stripping options were discussed above, and are not included here: 2955 o NATs [RFC3022] (Network Address (and Port) Translators) change the 2956 source address (and often source port) of packets. This means 2957 that a host will not know its public-facing address for signaling 2958 in MPTCP. Therefore, MPTCP permits implicit address addition via 2959 the MP_JOIN option, and the handshake mechanism ensures that 2960 connection attempts to private addresses [RFC1918] do not cause 2961 problems. Explicit address removal is undertaken by an Address ID 2962 to allow no knowledge of the source address. 2964 o Performance Enhancing Proxies (PEPs) [RFC3135] might proactively 2965 ACK data to increase performance. MPTCP, however, relies on 2966 accurate congestion control signals from the end host, and non- 2967 MPTCP-aware PEPs will not be able to provide such signals. MPTCP 2968 will, therefore, fall back to single-path TCP, or close the 2969 problematic subflow (see Section 3.8). 2971 o Traffic Normalizers [norm] may not allow holes in sequence 2972 numbers, and may cache packets and retransmit the same data. 2973 MPTCP looks like standard TCP on the wire, and will not retransmit 2974 different data on the same subflow sequence number. In the event 2975 of a retransmission, the same data will be retransmitted on the 2976 original TCP subflow even if it is additionally retransmitted at 2977 the connection level on a different subflow. 2979 o Firewalls [RFC2979] might perform initial sequence number 2980 randomization on TCP connections. MPTCP uses relative sequence 2981 numbers in data sequence mapping to cope with this. Like NATs, 2982 firewalls will not permit many incoming connections, so MPTCP 2983 supports address signaling (ADD_ADDR) so that a multiaddressed 2984 host can invite its peer behind the firewall/NAT to connect out to 2985 its additional interface. 2987 o Intrusion Detection Systems look out for traffic patterns and 2988 content that could threaten a network. Multipath will mean that 2989 such data is potentially spread, so it is more difficult for an 2990 IDS to analyze the whole traffic, and potentially increases the 2991 risk of false positives. However, for an MPTCP-aware IDS, tokens 2992 can be read by such systems to correlate multiple subflows and 2993 reassemble for analysis. 2995 o Application-level middleboxes such as content-aware firewalls may 2996 alter the payload within a subflow, such as rewriting URIs in HTTP 2997 traffic. MPTCP will detect these using the checksum and close the 2998 affected subflow(s), if there are other subflows that can be used. 2999 If all subflows are affected, multipath will fall back to TCP, 3000 allowing such middleboxes to change the payload. MPTCP-aware 3001 middleboxes should be able to adjust the payload and MPTCP 3002 metadata in order not to break the connection. 3004 In addition, all classes of middleboxes may affect TCP traffic in the 3005 following ways: 3007 o TCP options may be removed, or packets with unknown options 3008 dropped, by many classes of middleboxes. It is intended that the 3009 initial SYN exchange, with a TCP option, will be sufficient to 3010 identify the path capabilities. If such a packet does not get 3011 through, MPTCP will end up falling back to regular TCP. 3013 o Segmentation/Coalescing (e.g., TCP segmentation offloading) might 3014 copy options between packets and might strip some options. 3015 MPTCP's data sequence mapping includes the relative subflow 3016 sequence number instead of using the sequence number in the 3017 segment. In this way, the mapping is independent of the packets 3018 that carry it. 3020 o The receive window may be shrunk by some middleboxes at the 3021 subflow level. MPTCP will use the maximum window at data level, 3022 but will also obey subflow-specific windows. 3024 7. Acknowledgments 3026 The authors gratefully acknowledge significant input into this 3027 document from Sebastien Barre and Andrew McDonald. 3029 The authors also wish to acknowledge reviews and contributions from 3030 Iljitsch van Beijnum, Lars Eggert, Marcelo Bagnulo, Robert Hancock, 3031 Pasi Sarolahti, Toby Moncaster, Philip Eardley, Sergio Lembo, 3032 Lawrence Conroy, Yoshifumi Nishida, Bob Briscoe, Stein Gjessing, 3033 Andrew McGregor, Georg Hampel, Anumita Biswas, Wes Eddy, Alexey 3034 Melnikov, Francis Dupont, Adrian Farrel, Barry Leiba, Robert Sparks, 3035 Sean Turner, Stephen Farrell, Martin Stiemerling, Gregory Detal, and 3036 Fabien Duchene. 3038 8. IANA Considerations 3040 This document updates [RFC6824] and as such IANA is requested to 3041 update the TCP option space registry to point to this document for 3042 Multipath TCP, as follows: 3044 +------+--------+-----------------------+---------------+ 3045 | Kind | Length | Meaning | Reference | 3046 +------+--------+-----------------------+---------------+ 3047 | 30 | N | Multipath TCP (MPTCP) | This document | 3048 +------+--------+-----------------------+---------------+ 3050 Table 1: TCP Option Kind Numbers 3052 8.1. MPTCP Option Subtypes 3054 The 4-bit MPTCP subtype sub-registry ("MPTCP Option Subtypes" under 3055 the "Transmission Control Protocol (TCP) Parameters" registry) was 3056 defined in [RFC6824]. This document defines one additional subtype 3057 (ADD_ADDR) and updates the references to this document for all sub- 3058 types except ADD_ADDR, which is deprecated. The updates are listed 3059 in the following table. 3061 +-------+-----------------+-------------------------+---------------+ 3062 | Value | Symbol | Name | Reference | 3063 +-------+-----------------+-------------------------+---------------+ 3064 | 0x0 | MP_CAPABLE | Multipath Capable | This | 3065 | | | | document, | 3066 | | | | Section 3.1 | 3067 | 0x1 | MP_JOIN | Join Connection | This | 3068 | | | | document, | 3069 | | | | Section 3.2 | 3070 | 0x2 | DSS | Data Sequence Signal | This | 3071 | | | (Data ACK and data | document, | 3072 | | | sequence mapping) | Section 3.3 | 3073 | 0x3 | ADD_ADDR | Add Address | This | 3074 | | | | document, | 3075 | | | | Section 3.4.1 | 3076 | 0x4 | REMOVE_ADDR | Remove Address | This | 3077 | | | | document, | 3078 | | | | Section 3.4.2 | 3079 | 0x5 | MP_PRIO | Change Subflow Priority | This | 3080 | | | | document, | 3081 | | | | Section 3.3.8 | 3082 | 0x6 | MP_FAIL | Fallback | This | 3083 | | | | document, | 3084 | | | | Section 3.8 | 3085 | 0x7 | MP_FASTCLOSE | Fast Close | This | 3086 | | | | document, | 3087 | | | | Section 3.5 | 3088 | 0x8 | MP_TCPRST | Subflow Reset | This | 3089 | | | | document, | 3090 | | | | Section 3.6 | 3091 | 0xf | MP_EXPERIMENTAL | MPTCP Experimental | This | 3092 | | | Option | document, | 3093 | | | | Section 3.7 | 3094 +-------+-----------------+-------------------------+---------------+ 3096 Table 2: MPTCP Option Subtypes 3098 Values 0x9 through 0xe are currently unassigned. 3100 8.2. MPTCP Handshake Algorithms 3102 IANA has created another sub-registry, "MPTCP Handshake Algorithms" 3103 under the "Transmission Control Protocol (TCP) Parameters" registry, 3104 based on the flags in MP_CAPABLE (Section 3.1). IANA is requested to 3105 update the references of this table to this document, as follows: 3107 +---------+----------------------------------+----------------------+ 3108 | Flag | Meaning | Reference | 3109 | Bit | | | 3110 +---------+----------------------------------+----------------------+ 3111 | A | Checksum required | This document, | 3112 | | | Section 3.1 | 3113 | B | Extensibility | This document, | 3114 | | | Section 3.1 | 3115 | C | Do not attempt to connect to | This document, | 3116 | | source address | Section 3.1 | 3117 | D-G | Unassigned | | 3118 | H | HMAC-SHA256 | This document, | 3119 | | | Section 3.2 | 3120 +---------+----------------------------------+----------------------+ 3122 Table 3: MPTCP Handshake Algorithms 3124 Note that the meanings of bits D through H can be dependent upon bit 3125 B, depending on how Extensibility is defined in future 3126 specifications; see Section 3.1 for more information. 3128 Future assignments in this registry are also to be defined by 3129 Standards Action as defined by [RFC5226]. Assignments consist of the 3130 value of the flags, a symbolic name for the algorithm, and a 3131 reference to its specification. 3133 8.3. MP_TCPRST Reason Codes 3135 IANA is requested to create a further sub-registry, "MP_TCPRST Reason 3136 Codes" under the "Transmission Control Protocol (TCP) Parameters" 3137 registry, based on the reason code in MP_TCPRST (Section 3.6). The 3138 contents of this sub-registry are to to this document, as follows: 3140 +------+-----------------------------+----------------------------+ 3141 | Code | Meaning | Reference | 3142 +------+-----------------------------+----------------------------+ 3143 | 0x00 | Unspecified TCP error | This document, Section 3.6 | 3144 | 0x01 | MPTCP specific error | This document, Section 3.6 | 3145 | 0x02 | Lack of resources | This document, Section 3.6 | 3146 | 0x03 | Administratively prohibited | This document, Section 3.6 | 3147 | 0x04 | Too much outstanding data | This document, Section 3.6 | 3148 | 0x05 | Unacceptable performance | This document, Section 3.6 | 3149 | 0x06 | Middlebox interference | This document, Section 3.6 | 3150 +------+-----------------------------+----------------------------+ 3152 Table 4: MPTCP MP_TCPRST Reason Codes 3154 8.4. Experimental option registry 3156 Section 3.7 has defined the MP_EXPERIMENTAL option for private, 3157 experimental MPTCP options, and the same considerations as for 3158 [RFC6994] apply. IANA should create a "Multipath TCP Experimental 3159 Option Identifiers (MPTCP ExIDs)" sub-registry. This registry 3160 contains the 16 bits ExIDs and a reference (description, document 3161 pointer, or assignee name and e-mail contact) for each entry. MPTCP 3162 ExIDs are assigned on a First Come, First Served (FCFS) basis 3163 [RFC5226]. 3165 IANA will advise applicants of duplicate entries to select an 3166 alternate value, as per typical FCFS processing. 3168 IANA will record known duplicate uses to assist the community in both 3169 debugging assigned uses as well as correcting unauthorized duplicate 3170 uses. 3172 IANA should impose no requirement on making a registration other than 3173 indicating the desired codepoint and providing a point of contact. A 3174 short description or acronym for the use is desired but should not be 3175 required. 3177 9. References 3179 9.1. Normative References 3181 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 3182 RFC 793, DOI 10.17487/RFC0793, September 1981, 3183 . 3185 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3186 Requirement Levels", BCP 14, RFC 2119, 3187 DOI 10.17487/RFC2119, March 1997, 3188 . 3190 [RFC6182] Ford, A., Raiciu, C., Handley, M., Barre, S., and J. 3191 Iyengar, "Architectural Guidelines for Multipath TCP 3192 Development", RFC 6182, DOI 10.17487/RFC6182, March 2011, 3193 . 3195 [SHS] National Institute of Science and Technology, "Secure Hash 3196 Standard", Federal Information Processing Standard 3197 (FIPS) 180-4, August 2015, 3198 . 3201 9.2. Informative References 3203 [howhard] Raiciu, C., Paasch, C., Barre, S., Ford, A., Honda, M., 3204 Duchene, F., Bonaventure, O., and M. Handley, "How Hard 3205 Can It Be? Designing and Implementing a Deployable 3206 Multipath TCP", Usenix Symposium on Networked Systems 3207 Design and Implementation 2012, 2012, 3208 . 3211 [norm] Handley, M., Paxson, V., and C. Kreibich, "Network 3212 Intrusion Detection: Evasion, Traffic Normalization, and 3213 End-to-End Protocol Semantics", Usenix Security 2001, 3214 2001, 3215 . 3218 [RFC1122] Braden, R., Ed., "Requirements for Internet Hosts - 3219 Communication Layers", STD 3, RFC 1122, 3220 DOI 10.17487/RFC1122, October 1989, 3221 . 3223 [RFC1323] Jacobson, V., Braden, R., and D. Borman, "TCP Extensions 3224 for High Performance", RFC 1323, DOI 10.17487/RFC1323, May 3225 1992, . 3227 [RFC1918] Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G., 3228 and E. Lear, "Address Allocation for Private Internets", 3229 BCP 5, RFC 1918, DOI 10.17487/RFC1918, February 1996, 3230 . 3232 [RFC2018] Mathis, M., Mahdavi, J., Floyd, S., and A. Romanow, "TCP 3233 Selective Acknowledgment Options", RFC 2018, 3234 DOI 10.17487/RFC2018, October 1996, 3235 . 3237 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 3238 Hashing for Message Authentication", RFC 2104, 3239 DOI 10.17487/RFC2104, February 1997, 3240 . 3242 [RFC2979] Freed, N., "Behavior of and Requirements for Internet 3243 Firewalls", RFC 2979, DOI 10.17487/RFC2979, October 2000, 3244 . 3246 [RFC2992] Hopps, C., "Analysis of an Equal-Cost Multi-Path 3247 Algorithm", RFC 2992, DOI 10.17487/RFC2992, November 2000, 3248 . 3250 [RFC3022] Srisuresh, P. and K. Egevang, "Traditional IP Network 3251 Address Translator (Traditional NAT)", RFC 3022, 3252 DOI 10.17487/RFC3022, January 2001, 3253 . 3255 [RFC3135] Border, J., Kojo, M., Griner, J., Montenegro, G., and Z. 3256 Shelby, "Performance Enhancing Proxies Intended to 3257 Mitigate Link-Related Degradations", RFC 3135, 3258 DOI 10.17487/RFC3135, June 2001, 3259 . 3261 [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition 3262 of Explicit Congestion Notification (ECN) to IP", 3263 RFC 3168, DOI 10.17487/RFC3168, September 2001, 3264 . 3266 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 3267 "Randomness Requirements for Security", BCP 106, RFC 4086, 3268 DOI 10.17487/RFC4086, June 2005, 3269 . 3271 [RFC4987] Eddy, W., "TCP SYN Flooding Attacks and Common 3272 Mitigations", RFC 4987, DOI 10.17487/RFC4987, August 2007, 3273 . 3275 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 3276 IANA Considerations Section in RFCs", RFC 5226, 3277 DOI 10.17487/RFC5226, May 2008, 3278 . 3280 [RFC5681] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion 3281 Control", RFC 5681, DOI 10.17487/RFC5681, September 2009, 3282 . 3284 [RFC5961] Ramaiah, A., Stewart, R., and M. Dalal, "Improving TCP's 3285 Robustness to Blind In-Window Attacks", RFC 5961, 3286 DOI 10.17487/RFC5961, August 2010, 3287 . 3289 [RFC6181] Bagnulo, M., "Threat Analysis for TCP Extensions for 3290 Multipath Operation with Multiple Addresses", RFC 6181, 3291 DOI 10.17487/RFC6181, March 2011, 3292 . 3294 [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms 3295 (SHA and SHA-based HMAC and HKDF)", RFC 6234, 3296 DOI 10.17487/RFC6234, May 2011, 3297 . 3299 [RFC6356] Raiciu, C., Handley, M., and D. Wischik, "Coupled 3300 Congestion Control for Multipath Transport Protocols", 3301 RFC 6356, DOI 10.17487/RFC6356, October 2011, 3302 . 3304 [RFC6528] Gont, F. and S. Bellovin, "Defending against Sequence 3305 Number Attacks", RFC 6528, DOI 10.17487/RFC6528, February 3306 2012, . 3308 [RFC6824] Ford, A., Raiciu, C., Handley, M., and O. Bonaventure, 3309 "TCP Extensions for Multipath Operation with Multiple 3310 Addresses", RFC 6824, DOI 10.17487/RFC6824, January 2013, 3311 . 3313 [RFC6897] Scharf, M. and A. Ford, "Multipath TCP (MPTCP) Application 3314 Interface Considerations", RFC 6897, DOI 10.17487/RFC6897, 3315 March 2013, . 3317 [RFC6994] Touch, J., "Shared Use of Experimental TCP Options", 3318 RFC 6994, DOI 10.17487/RFC6994, August 2013, 3319 . 3321 [RFC7413] Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP 3322 Fast Open", RFC 7413, DOI 10.17487/RFC7413, December 2014, 3323 . 3325 [TCPLO] Ramaiah, A., "TCP option space extension", Work 3326 in Progress, March 2012. 3328 Appendix A. Notes on Use of TCP Options 3330 The TCP option space is limited due to the length of the Data Offset 3331 field in the TCP header (4 bits), which defines the TCP header length 3332 in 32-bit words. With the standard TCP header being 20 bytes, this 3333 leaves a maximum of 40 bytes for options, and many of these may 3334 already be used by options such as timestamp and SACK. 3336 We have performed a brief study on the commonly used TCP options in 3337 SYN, data, and pure ACK packets, and found that there is enough room 3338 to fit all the options we propose using in this document. 3340 SYN packets typically include Maximum Segment Size (MSS) (4 bytes), 3341 window scale (3 bytes), SACK permitted (2 bytes), and timestamp (10 3342 bytes) options. Together these sum to 19 bytes. Some operating 3343 systems appear to pad each option up to a word boundary, thus using 3344 24 bytes (a brief survey suggests Windows XP and Mac OS X do this, 3345 whereas Linux does not). Optimistically, therefore, we have 21 bytes 3346 spare, or 16 if it has to be word-aligned. In either case, however, 3347 the SYN versions of Multipath Capable (12 bytes) and Join (12 or 16 3348 bytes) options will fit in this remaining space. 3350 Note that due to the use of a 64-bit data-level sequence space, it is 3351 feasible that MPTCP will not require the timestamp option for 3352 protection against wrapped sequence numbers (PAWS [RFC1323]), since 3353 the data-level sequence space has far less chance of wrapping. 3354 Confirmation of the validity of this optimisation is for further 3355 study. 3357 TCP data packets typically carry timestamp options in every packet, 3358 taking 10 bytes (or 12 with padding). That leaves 30 bytes (or 28, 3359 if word-aligned). The Data Sequence Signal (DSS) option varies in 3360 length depending on whether the data sequence mapping and DATA_ACK 3361 are included, and whether the sequence numbers in use are 4 or 8 3362 octets. The maximum size of the DSS option is 28 bytes, so even that 3363 will fit in the available space. But unless a connection is both 3364 bidirectional and high-bandwidth, it is unlikely that all that option 3365 space will be required on each DSS option. 3367 Within the DSS option, it is not necessary to include the data 3368 sequence mapping and DATA_ACK in each packet, and in many cases it 3369 may be possible to alternate their presence (so long as the mapping 3370 covers the data being sent in the following packet). It would also 3371 be possible to alternate between 4- and 8-byte sequence numbers in 3372 each option. 3374 On subflow and connection setup, an MPTCP option is also set on the 3375 third packet (an ACK). These are 20 bytes (for Multipath Capable) 3376 and 24 bytes (for Join), both of which will fit in the available 3377 option space. 3379 Pure ACKs in TCP typically contain only timestamps (10 bytes). Here, 3380 Multipath TCP typically needs to encode only the DATA_ACK (maximum of 3381 12 bytes). Occasionally, ACKs will contain SACK information. 3382 Depending on the number of lost packets, SACK may utilize the entire 3383 option space. If a DATA_ACK had to be included, then it is probably 3384 necessary to reduce the number of SACK blocks to accommodate the 3385 DATA_ACK. However, the presence of the DATA_ACK is unlikely to be 3386 necessary in a case where SACK is in use, since until at least some 3387 of the SACK blocks have been retransmitted, the cumulative data-level 3388 ACK will not be moving forward (or if it does, due to retransmissions 3389 on another path, then that path can also be used to transmit the new 3390 DATA_ACK). 3392 The ADD_ADDR option can be between 16 and 30 bytes, depending on 3393 whether IPv4 or IPv6 is used, and whether or not the port number is 3394 present. It is unlikely that such signaling would fit in a data 3395 packet (although if there is space, it is fine to include it). It is 3396 recommended to use duplicate ACKs with no other payload or options in 3397 order to transmit these rare signals. Note this is the reason for 3398 mandating that duplicate ACKs with MPTCP options are not taken as a 3399 signal of congestion. 3401 Finally, there are issues with reliable delivery of options. As 3402 options can also be sent on pure ACKs, these are not reliably sent. 3403 This is not an issue for DATA_ACK due to their cumulative nature, but 3404 may be an issue for ADD_ADDR/REMOVE_ADDR options. Here, it is 3405 recommended to send these options redundantly (whether on multiple 3406 paths or on the same path on a number of ACKs -- but interspersed 3407 with data in order to avoid interpretation as congestion). The cases 3408 where options are stripped by middleboxes are discussed in Section 6. 3410 Appendix B. Control Blocks 3412 Conceptually, an MPTCP connection can be represented as an MPTCP 3413 control block that contains several variables that track the progress 3414 and the state of the MPTCP connection and a set of linked TCP control 3415 blocks that correspond to the subflows that have been established. 3417 RFC 793 [RFC0793] specifies several state variables. Whenever 3418 possible, we reuse the same terminology as RFC 793 to describe the 3419 state variables that are maintained by MPTCP. 3421 B.1. MPTCP Control Block 3423 The MPTCP control block contains the following variable per 3424 connection. 3426 B.1.1. Authentication and Metadata 3428 Local.Token (32 bits): This is the token chosen by the local host on 3429 this MPTCP connection. The token MUST be unique among all 3430 established MPTCP connections, generated from the local key. 3432 Local.Key (64 bits): This is the key sent by the local host on this 3433 MPTCP connection. 3435 Remote.Token (32 bits): This is the token chosen by the remote host 3436 on this MPTCP connection, generated from the remote key. 3438 Remote.Key (64 bits): This is the key chosen by the remote host on 3439 this MPTCP connection 3441 MPTCP.Checksum (flag): This flag is set to true if at least one of 3442 the hosts has set the A bit in the MP_CAPABLE options exchanged 3443 during connection establishment, and is set to false otherwise. 3444 If this flag is set, the checksum must be computed in all DSS 3445 options. 3447 B.1.2. Sending Side 3449 SND.UNA (64 bits): This is the data sequence number of the next byte 3450 to be acknowledged, at the MPTCP connection level. This variable 3451 is updated upon reception of a DSS option containing a DATA_ACK. 3453 SND.NXT (64 bits): This is the data sequence number of the next byte 3454 to be sent. SND.NXT is used to determine the value of the DSN in 3455 the DSS option. 3457 SND.WND (32 bits with RFC 1323, 16 bits otherwise): This is the 3458 sending window. MPTCP maintains the sending window at the MPTCP 3459 connection level and the same window is shared by all subflows. 3460 All subflows use the MPTCP connection level SND.WND to compute the 3461 SEQ.WND value that is sent in each transmitted segment. 3463 B.1.3. Receiving Side 3465 RCV.NXT (64 bits): This is the data sequence number of the next byte 3466 that is expected on the MPTCP connection. This state variable is 3467 modified upon reception of in-order data. The value of RCV.NXT is 3468 used to specify the DATA_ACK that is sent in the DSS option on all 3469 subflows. 3471 RCV.WND (32 bits with RFC 1323, 16 bits otherwise): This is the 3472 connection-level receive window, which is the maximum of the 3473 RCV.WND on all the subflows. 3475 B.2. TCP Control Blocks 3477 The MPTCP control block also contains a list of the TCP control 3478 blocks that are associated to the MPTCP connection. 3480 Note that the TCP control block on the TCP subflows does not contain 3481 the RCV.WND and SND.WND state variables as these are maintained at 3482 the MPTCP connection level and not at the subflow level. 3484 Inside each TCP control block, the following state variables are 3485 defined. 3487 B.2.1. Sending Side 3489 SND.UNA (32 bits): This is the sequence number of the next byte to 3490 be acknowledged on the subflow. This variable is updated upon 3491 reception of each TCP acknowledgment on the subflow. 3493 SND.NXT (32 bits): This is the sequence number of the next byte to 3494 be sent on the subflow. SND.NXT is used to set the value of 3495 SEG.SEQ upon transmission of the next segment. 3497 B.2.2. Receiving Side 3499 RCV.NXT (32 bits): This is the sequence number of the next byte that 3500 is expected on the subflow. This state variable is modified upon 3501 reception of in-order segments. The value of RCV.NXT is copied to 3502 the SEG.ACK field of the next segments transmitted on the subflow. 3504 RCV.WND (32 bits with RFC 1323, 16 bits otherwise): This is the 3505 subflow-level receive window that is updated with the window field 3506 from the segments received on this subflow. 3508 Appendix C. Finite State Machine 3510 The diagram in Figure 23 shows the Finite State Machine for 3511 connection-level closure. This illustrates how the DATA_FIN 3512 connection-level signal (indicated as the DFIN flag on a DATA_ACK) 3513 interacts with subflow-level FINs, and permits "break-before-make" 3514 handover between subflows. 3516 +---------+ 3517 | M_ESTAB | 3518 +---------+ 3519 M_CLOSE | | rcv DATA_FIN 3520 ------- | | ------- 3521 +---------+ snd DATA_FIN / \ snd DATA_ACK[DFIN] +---------+ 3522 | M_FIN |<----------------- ------------------->| M_CLOSE | 3523 | WAIT-1 |--------------------------- | WAIT | 3524 +---------+ rcv DATA_FIN \ +---------+ 3525 | rcv DATA_ACK[DFIN] ------- | M_CLOSE | 3526 | -------------- snd DATA_ACK | ------- | 3527 | CLOSE all subflows | snd DATA_FIN | 3528 V V V 3529 +-----------+ +-----------+ +-----------+ 3530 |M_FINWAIT-2| | M_CLOSING | | M_LAST-ACK| 3531 +-----------+ +-----------+ +-----------+ 3532 | rcv DATA_ACK[DFIN] | rcv DATA_ACK[DFIN] | 3533 | rcv DATA_FIN -------------- | -------------- | 3534 | ------- CLOSE all subflows | CLOSE all subflows | 3535 | snd DATA_ACK[DFIN] V delete MPTCP PCB V 3536 \ +-----------+ +---------+ 3537 ------------------------>|M_TIME WAIT|----------------->| M_CLOSED| 3538 +-----------+ +---------+ 3539 All subflows in CLOSED 3540 ------------ 3541 delete MPTCP PCB 3543 Figure 23: Finite State Machine for Connection Closure 3545 Authors' Addresses 3547 Alan Ford 3548 Pexip 3550 EMail: alan.ford@gmail.com 3552 Costin Raiciu 3553 University Politehnica of Bucharest 3554 Splaiul Independentei 313 3555 Bucharest 3556 Romania 3558 EMail: costin.raiciu@cs.pub.ro 3559 Mark Handley 3560 University College London 3561 Gower Street 3562 London WC1E 6BT 3563 UK 3565 EMail: m.handley@cs.ucl.ac.uk 3567 Olivier Bonaventure 3568 Universite catholique de Louvain 3569 Pl. Ste Barbe, 2 3570 Louvain-la-Neuve 1348 3571 Belgium 3573 EMail: olivier.bonaventure@uclouvain.be 3575 Christoph Paasch 3576 Apple, Inc. 3577 Cupertino 3578 US 3580 EMail: cpaasch@apple.com