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