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