idnits 2.17.00 (12 Aug 2021) /tmp/idnits16384/draft-irtf-dtnrg-tcp-clayer-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 10, 2014) is 2987 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- == Missing Reference: 'L1' is mentioned on line 309, but not defined == Missing Reference: 'L2' is mentioned on line 309, but not defined == Missing Reference: 'L3' is mentioned on line 314, but not defined == Missing Reference: 'RFCXXXX' is mentioned on line 932, but not defined == Unused Reference: 'RFC6256' is defined on line 992, but no explicit reference was found in the text ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) Summary: 1 error (**), 0 flaws (~~), 6 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Delay Tolerant Networking Research Group M. Demmer 3 Internet-Draft UC Berkeley 4 Intended status: Experimental J. Ott 5 Expires: September 11, 2014 Helsinki University of Technology 6 S. Perreault 7 Viagenie 8 March 10, 2014 10 Delay Tolerant Networking TCP Convergence Layer Protocol 11 draft-irtf-dtnrg-tcp-clayer-09.txt 13 Abstract 15 This document describes the protocol for the TCP-based Convergence 16 Layer for Delay Tolerant Networking (DTN). It is the product of the 17 IRTF's DTN Research Group (DTNRG). 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on September 11, 2014. 36 Copyright Notice 38 Copyright (c) 2014 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 54 2. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . 4 55 2.1. Definitions specific to the TCPCL Protocol . . . . . . . 4 56 3. General Protocol Description . . . . . . . . . . . . . . . . 5 57 3.1. Bidirectional Use of TCP Connection . . . . . . . . . . . 6 58 3.2. Example message exchange . . . . . . . . . . . . . . . . 6 59 4. Connection Establishment . . . . . . . . . . . . . . . . . . 8 60 4.1. Contact Header . . . . . . . . . . . . . . . . . . . . . 9 61 4.2. Validation and parameter negotiation . . . . . . . . . . 11 62 5. Established Connection Operation . . . . . . . . . . . . . . 12 63 5.1. Message Type Codes . . . . . . . . . . . . . . . . . . . 12 64 5.2. Bundle Data Transmission (DATA_SEGMENT) . . . . . . . . . 13 65 5.3. Bundle Acknowledgments (ACK_SEGMENT) . . . . . . . . . . 14 66 5.4. Bundle Refusal (REFUSE_BUNDLE) . . . . . . . . . . . . . 15 67 5.5. Bundle Length (LENGTH) . . . . . . . . . . . . . . . . . 16 68 5.6. Keepalive Messages (KEEPALIVE) . . . . . . . . . . . . . 17 69 6. Connection Termination . . . . . . . . . . . . . . . . . . . 18 70 6.1. Shutdown Message (SHUTDOWN) . . . . . . . . . . . . . . . 18 71 6.2. Idle Connection Shutdown . . . . . . . . . . . . . . . . 19 72 7. Security Considerations . . . . . . . . . . . . . . . . . . . 19 73 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 74 8.1. Port Number . . . . . . . . . . . . . . . . . . . . . . . 20 75 8.2. Protocol Versions . . . . . . . . . . . . . . . . . . . . 21 76 8.3. Message Types . . . . . . . . . . . . . . . . . . . . . . 21 77 8.4. REFUSE Reason Codes . . . . . . . . . . . . . . . . . . . 21 78 8.5. SHUTDOWN Reason Codes . . . . . . . . . . . . . . . . . . 22 79 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 22 80 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 22 81 10.1. Normative References . . . . . . . . . . . . . . . . . . 22 82 10.2. Informative References . . . . . . . . . . . . . . . . . 22 83 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 85 1. Introduction 87 This document describes the TCP-based convergence layer protocol for 88 Delay Tolerant Networking (TCPCL). Delay Tolerant Networking is an 89 end-to-end architecture providing communications in and/or through 90 highly stressed environments, including those with intermittent 91 connectivity, long and/or variable delays, and high bit error rates. 92 More detailed descriptions of the rationale and capabilities of these 93 networks can be found in the Delay-Tolerant Network Architecture 94 [RFC4838] RFC. 96 An important goal of the DTN architecture is to accommodate a wide 97 range of networking technologies and environments. The protocol used 98 for DTN communications is the Bundling Protocol (BP) [RFC5050], an 99 application-layer protocol that is used to construct a store-and- 100 forward overlay network. As described in the Bundle Protocol 101 specification, it requires the services of a "convergence layer 102 adapter" (CLA) to send and receive bundles using the service of some 103 "native" link, network, or internet protocol. This document 104 describes one such convergence layer adapter that uses the well-known 105 Transmission Control Protocol (TCP). This convergence layer is 106 referred to as TCPCL. 108 The locations of the TCPCL and the BP in the Internet model protocol 109 stack are shown in Figure 1. In particular, when BP is using TCP as 110 its bearer with TCPCL as its convergence layer, both BP and TCPCL 111 reside at the application layer of the Internet model. 113 +-------------------------+ 114 | DTN Application | -\ 115 +-------------------------| | 116 | Bundle Protocol (BP) | -> Application Layer 117 +-------------------------+ | 118 | TCP Conv. Layer (TCPCL) | -/ 119 +-------------------------+ 120 | TCP | ---> Transport Layer 121 +-------------------------+ 122 | IP | ---> Network Layer 123 +-------------------------+ 124 | Link-Layer Protocol | ---> Link Layer 125 +-------------------------+ 126 | Physical Medium | ---> Physical Layer 127 +-------------------------+ 129 Figure 1: The locations of the Bundle Protocol and the TCP 130 convergence layer protocol in the Internet protocol stack 132 This document describes the format of the protocol data units passed 133 between entities participating in TCPCL communications. This 134 document does not address: 136 The format of protocol data units of the Bundle Protocol, as 137 those are defined elsewhere [RFC5050]. 139 Mechanisms for locating or identifying other bundle nodes within 140 an internet. 142 Note that this document describes version 3 of the protocol. 143 Versions 0, 1, and 2 were never specified in any Internet Draft, RFC, 144 or any other public document. These prior versions of the protocol 145 were, however, implemented in the DTN reference implementation 146 [refs.dtnimpl], in prior releases, hence the current version number 147 reflects the existence of those prior versions. 149 This is an experimental protocol produced within the IRTF's Delay 150 Tolerant Networking Research Group (DTNRG). It represents the 151 consensus of all active contributors to this group. If this protocol 152 is used on the Internet, IETF standard protocols for security and 153 congestion control should be used. 155 2. Definitions 157 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 158 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 159 document are to be interpreted as described in [RFC2119]. 161 The terms defined in Section 3.1 of [RFC5050] are used extensively in 162 this document. 164 2.1. Definitions specific to the TCPCL Protocol 166 This section contains definitions that are interpreted to be specific 167 to the operation of the TCPCL protocol, as described below. 169 TCP Connection -- A TCP connection refers to a transport connection 170 using TCP as the transport protocol. 172 TCPCL Connection -- A TCPCL connection (as opposed to a TCP 173 connection) is a TCPCL communication relationship between two 174 bundle nodes. The lifetime of a TCPCL connection is bound to 175 the lifetime of an underlying TCP connection. Therefore a TCPCL 176 connection is initiated when a bundle node initiates a TCP 177 connection to be established for the purposes of bundle 178 communication. A TCPCL connection is terminated when the TCP 179 connection ends, due either to one or both nodes actively 180 terminating the TCP connection or due to network errors causing 181 a failure of the TCP connection. For the remainder of this 182 document, the term "connection" without the prefix "TCPCL" shall 183 refer to a TCPCL connection. 185 Connection parameters -- The connection parameters are a set of 186 values used to affect the operation of the TCPCL for a given 187 connection. The manner in which these parameters are conveyed 188 to the bundle node and thereby to the TCPCL is implementation- 189 dependent. However, the mechanism by which two bundle nodes 190 exchange and negotiate the values to be used for a given session 191 is described in Section Section 4.2. 193 Transmission -- Transmission refers to the procedures and mechanisms 194 (described below) for conveyance of a bundle from one node to 195 another. 197 3. General Protocol Description 199 The service of this protocol is the transmission of DTN bundles over 200 TCP. This document specifies the encapsulation of bundles, 201 procedures for TCP setup and teardown, and a set of messages and node 202 requirements. The general operation of the protocol is as follows: 204 First one node establishes a TCPCL connection to the other by 205 initiating a TCP connection. After setup of the TCP connection is 206 complete, an initial contact header is exchanged in both directions 207 to set parameters of the TCPCL connection and exchange a singleton 208 endpoint identifier for each node (not the singleton EID of any 209 application running on the node), to denote the bundle-layer identity 210 of each DTN node. This is used to assist in routing and forwarding 211 messages, e.g., to prevent loops. 213 Once the TCPCL connection is established and configured in this way, 214 bundles can be transmitted in either direction. Each bundle is 215 transmitted in one or more logical segments of formatted bundle data. 216 Each logical data segment consists of a DATA_SEGMENT message header, 217 an SDNV containing the length of the segment, and finally the byte 218 range of the bundle data. The choice of the length to use for 219 segments is an implementation matter. The first segment for a bundle 220 must set the 'start' flag and the last one must set the 'end' flag in 221 the DATA_SEGMENT message header. 223 If multiple bundles are transmitted on a single TCPCL connection, 224 they MUST be transmitted consecutively. Interleaving data segments 225 from different bundles is not allowed. Bundle interleaving can be 226 accomplished by fragmentation at the BP layer. 228 An optional feature of the protocol is for the receiving node to send 229 acknowledgments as bundle data segments arrive (ACK_SEGMENT). The 230 rationale behind these acknowledgments is to enable the sender node 231 to determine how much of the bundle has been received, so that in 232 case the connection is interrupted, it can perform reactive 233 fragmentation to avoid re-sending the already transmitted part of the 234 bundle. 236 When acknowledgments are enabled, then for each data segment that is 237 received, the receiving node sends an ACK_SEGMENT code followed by an 238 SDNV containing the cumulative length of the bundle that has been 239 received. The sending node may transmit multiple DATA_SEGMENT 240 messages without necessarily waiting for the corresponding 241 ACK_SEGMENT responses. This enables pipelining of messages on a 242 channel. In addition, there is no explicit flow control on the TCPCL 243 layer. 245 Another optional feature is that a receiver may interrupt the 246 transmission of a bundle at any point in time by replying with a 247 REFUSE_BUNDLE message which causes the sender to stop transmission of 248 the current bundle, after completing transmission of a partially sent 249 data segment. Note: This enables a cross-layer optimization in that 250 it allows a receiver that detects that it already has received a 251 certain bundle to interrupt transmission as early as possible and 252 thus save transmission capacity for other bundles. 254 For connections that are idle, a KEEPALIVE message may optionally be 255 sent at a negotiated interval. This is used to convey liveness 256 information. 258 Finally, before connections close, a SHUTDOWN message is sent on the 259 channel. After sending a SHUTDOWN message, the sender of this 260 message may send further acknowledgments (ACK_SEGMENT or 261 REFUSE_BUNDLE) but no further data messages (DATA_SEGMENT). A 262 SHUTDOWN message may also be used to refuse a connection setup by a 263 peer. 265 3.1. Bidirectional Use of TCP Connection 267 There are different specific messages for sending and receiving 268 operations (in addition to connection setup/teardown). TCPCL is 269 symmetric, i.e., both sides can start sending data segments in a 270 connection, and one side's bundle transfer does not have to complete 271 before the other side can start sending data segments on its own. 272 Hence, the protocol allows for a bi-directional mode of 273 communication. 275 Note that in the case of concurrent bidirectional transmission, ack 276 segments may be interleaved with data segments. 278 3.2. Example message exchange 279 The following figure visually depicts the protocol exchange for a 280 simple session, showing the connection establishment, and the 281 transmission of a single bundle split into three data segments (of 282 lengths L1, L2, and L3) from Node A to Node B. 284 Note that the sending node may transmit multiple DATA_SEGMENT 285 messages without necessarily waiting for the corresponding 286 ACK_SEGMENT responses. This enables pipelining of messages on a 287 channel. Although this example only demonstrates a single bundle 288 transmission, it is also possible to pipeline multiple DATA_SEGMENT 289 messages for different bundles without necessarily waiting for 290 ACK_SEGMENT messages to be returned for each one. However, 291 interleaving data segments from different bundles is not allowed. 293 No errors or rejections are shown in this example. 295 Node A Node B 296 ====== ====== 298 +-------------------------+ +-------------------------+ 299 | Contact Header | -> <- | Contact Header | 300 +-------------------------+ +-------------------------+ 302 +-------------------------+ 303 | DATA_SEGMENT (start) | -> 304 | SDNV length [L1] | -> 305 | Bundle Data 0..L1 | -> 306 +-------------------------+ 307 +-------------------------+ +-------------------------+ 308 | DATA_SEGMENT | -> <- | ACK_SEGMENT | 309 | SDNV length [L2] | -> <- | SDNV length [L1] | 310 | Bundle Data L1..L2 | -> +-------------------------+ 311 +-------------------------+ 312 +-------------------------+ +-------------------------+ 313 | DATA_SEGMENT (end) | -> <- | ACK_SEGMENT | 314 | SDNV length [L3] | -> <- | SDNV length [L1+L2] | 315 | Bundle Data L2..L3 | -> +-------------------------+ 316 +-------------------------+ 317 +-------------------------+ 318 <- | ACK_SEGMENT | 319 <- | SDNV length [L1+L2+L3] | 320 +-------------------------+ 322 +-------------------------+ +-------------------------+ 323 | SHUTDOWN | -> <- | SHUTDOWN | 324 +-------------------------+ +-------------------------+ 326 Figure 2: A simple visual example of the flow of protocol messages on 327 a single TCP session between two nodes (A and B) 329 4. Connection Establishment 331 For bundle transmissions to occur using the TCPCL, a TCPCL connection 332 must first be established between communicating nodes. It is up to 333 the implementation to decide how and when connection setup is 334 triggered. For example, some connections may be opened proactively 335 and maintained for as long as is possible given the network 336 conditions, while other connections may be opened only when there is 337 a bundle that is queued for transmission and the routing algorithm 338 selects a certain next hop node. 340 To establish a TCPCL connection, a node must first establish a TCP 341 connection with the intended peer node, typically by using the 342 services provided by the operating system. Port number 4556 has been 343 assigned by IANA as the well-known port number for the TCP 344 convergence layer. Other port numbers MAY be used per local 345 configuration. Determining a peer's port number (if different from 346 the well-known TCPCL port) is up to the implementation. 348 If the node is unable to establish a TCP connection for any reason, 349 then it is an implementation matter to determine how to handle the 350 connection failure. A node MAY decide to re-attempt to establish the 351 connection, perhaps. If it does so, it MUST NOT overwhelm its target 352 with repeated connection attempts. Therefore, the node MUST retry 353 the connection setup only after some delay (a 1 second minimum is 354 RECOMMENDED) and it SHOULD use a (binary) exponential backoff 355 mechanism to increase this delay in case of repeated failures. In 356 case a SHUTDOWN message specifying a reconnection delay is received, 357 that delay is used as the initial delay. The default initial delay 358 SHOULD be at least 1 second but SHOULD be configurable since it will 359 be application and network type dependent. 361 The node MAY declare failure after one or more connection attempts 362 and MAY attempt to find an alternate route for bundle data. Such 363 decisions are up to the higher layer (i.e., the BP). 365 Once a TCP connection is established, each node MUST immediately 366 transmit a contact header over the TCP connection. The format of the 367 contact header is described in Section 4.1. 369 Upon receipt of the contact header, both nodes perform the validation 370 and negotiation procedures defined in Section 4.2 372 After receiving the contact header from the other node, either node 373 MAY also refuse the connection by sending a SHUTDOWN message. If 374 connection setup is refused a reason MUST be included in the SHUTDOWN 375 message. 377 4.1. Contact Header 379 Once a TCP connection is established, both parties exchange a contact 380 header. This section describes the format of the contact header and 381 the meaning of its fields. 383 The format for the Contact Header is as follows: 385 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 386 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 387 +---------------+---------------+---------------+---------------+ 388 | magic='dtn!' | 389 +---------------+---------------+---------------+---------------+ 390 | version | flags | keepalive_interval | 391 +---------------+---------------+---------------+---------------+ 392 | local EID length (SDNV) | 393 +---------------+---------------+---------------+---------------+ 394 | | 395 + local EID (variable) + 396 | | 397 +---------------+---------------+---------------+---------------+ 399 Figure 3: Contact Header Format 401 The fields of the contact header are: 403 magic: A four byte field that always contains the byte sequence 0x64 404 0x74 0x6e 0x21, i.e., the text string "dtn!" in US-ASCII. 406 version: A one byte field value containing the value 3 (current 407 version of the protocol). 409 flags: A one byte field containing optional connection flags. The 410 first four bits are unused and MUST be set to zero upon 411 transmission and MUST be ignored upon reception. The last four 412 bits are interpreted as shown in table Table 1 below. 414 keepalive_interval: A two byte integer field containing the number 415 of seconds between exchanges of keepalive messages on the 416 connection (see Section 5.6). This value is in network byte 417 order, as are all other multi-byte fields described in this 418 protocol. 420 local eid length: A variable length SDNV field containing the length 421 of the endpoint identifier (EID) for some singleton endpoint in 422 which the sending node is a member. A four byte SDNV is 423 depicted for clarity of the figure. 425 local EID: An octet string containing the EID of some singleton 426 endpoint in which the sending node is a member, in the canonical 427 format of :. A eight byte 428 EID is shown for clarity of the figure. 430 +-------------+-----------------------------------------------------+ 431 | Value | Meaning | 432 +-------------+-----------------------------------------------------+ 433 | 00000001 | Request acknowledgment of bundle segments. | 434 | 00000010 | Request enabling of reactive fragmentation. | 435 | 00000100 | Indicate support for bundle refusal. This flag MUST | 436 | | NOT be set to '1' unless support for | 437 | | acknowledgments is also indicated. | 438 | 00001000 | Request sending of LENGTH messages. | 439 +-------------+-----------------------------------------------------+ 441 Table 1: Contact Header Flags 443 The manner in which values are configured and chosen for the various 444 flags and parameters in the contact header is implementation 445 dependent. 447 4.2. Validation and parameter negotiation 449 Upon reception of the contact header, each node follows the following 450 procedures for ensuring the validity of the TCPCL connection and to 451 negotiate values for the connection parameters. 453 If the magic string is not present or is not valid, the connection 454 MUST be terminated. The intent of the magic string is to provide 455 some protection against an inadvertent TCP connection by a different 456 protocol than the one described in this document. To prevent a flood 457 of repeated connections from a misconfigured application, a node MAY 458 elect to hold an invalid connection open and idle for some time 459 before closing it. 461 If a node receives a contact header containing a version that is 462 greater than the current version of the protocol that the node 463 implements, then the node SHOULD interpret all fields and messages as 464 it would normally. If a node receives a contact header with a 465 version that is lower than the version of the protocol that the node 466 implements, the node may either terminate the connection due to the 467 version mismatch, or may adapt its operation to conform to the older 468 version of the protocol. This decision is an implementation matter. 470 A node calculates the parameters for a TCPCL connection by 471 negotiating the values from its own preferences (conveyed by the 472 contact header it sent) with the preferences of the peer node 473 (expressed in the contact header that it received). This negotiation 474 MUST proceed in the following manner: 476 The segment acknowledgments enabled parameter is set to true iff 477 the corresponding flag is set in both contact headers. 479 The reactive fragmentation enabled parameter is set to true iff 480 the corresponding flag is set in both contact headers. 482 The bundle refusal capability is set to true if the 483 corresponding flag is set in both contact headers and if segment 484 acknowledgment has been enabled. 486 The keepalive_interval parameter is set to the minimum value 487 from both contact headers. If one or both contact headers 488 contains the value zero, then the keepalive feature (described 489 in Section 5.6) is disabled. 491 Once this process of parameter negotiation is completed, the protocol 492 defines no additional mechanism to change the parameters of an 493 established connection; to effect such a change, the connection MUST 494 be terminated and a new connection established. 496 5. Established Connection Operation 498 This section describes the protocol operation for the duration of an 499 established connection, including the mechanisms for transmitting 500 bundles over the connection. 502 5.1. Message Type Codes 504 After the initial exchange of a contact header, all messages 505 transmitted over the connection are identified by a one octet header 506 with the following structure: 508 0 1 2 3 4 5 6 7 509 +-+-+-+-+-+-+-+-+ 510 | type | flags | 511 +-+-+-+-+-+-+-+-+ 513 type: Indicates the type of the message as per Table 2 below 515 flags: Optional flags defined on a per message type basis. 517 The types and values for the message type code are as follows. 519 +-----------------+-----------+-------------------------------------+ 520 | Type | Code | Description | 521 +-----------------+-----------+-------------------------------------+ 522 | | 0x0 | Reserved. | 523 | | | | 524 | DATA_SEGMENT | 0x1 | Indicates the transmission of a | 525 | | | segment of bundle data, described | 526 | | | in Section 5.2. | 527 | | | | 528 | ACK_SEGMENT | 0x2 | Acknowledges reception of a data | 529 | | | segment, described in Section 5.3 | 530 | | | | 531 | REFUSE_BUNDLE | 0x3 | Indicates that the transmission of | 532 | | | the current bundle shall be | 533 | | | stopped, described in Section 5.4. | 534 | | | | 535 | KEEPALIVE | 0x4 | Keepalive message for the | 536 | | | connection, described in Section | 537 | | | 5.6. | 538 | | | | 539 | SHUTDOWN | 0x5 | Indicates that one of the nodes | 540 | | | participating in the connection | 541 | | | wishes to cleanly terminate the | 542 | | | connection, described in Section 6. | 543 | | | | 544 | LENGTH | 0x6 | Contains the length (in bytes) of | 545 | | | the next bundle, described in | 546 | | | Section 5.5. | 547 | | | | 548 | | 0x7-0xf | Unassigned. | 549 | | | | 550 +-----------------+-----------+-------------------------------------+ 552 Table 2: TCPCL Message Types 554 5.2. Bundle Data Transmission (DATA_SEGMENT) 556 Each bundle is transmitted in one or more data segments. The format 557 of a data segment message follows: 559 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 560 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 561 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 562 | 0x1 |0|0|S|E| length ... | contents.... | 563 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 565 Figure 4: Format of bundle data segment messages 567 The type portion of the message header contains the value 0x1. 569 The flags portion of the message header octet contains two optional 570 values in the two low-order bits, denoted 'S' and 'E' above. The 'S' 571 bit MUST be set to one iff it precedes the transmission of the first 572 segment of a new bundle. The 'E' bit MUST be set to one when 573 transmitting the last segment of a bundle. 575 Following the message header, the length field is an SDNV containing 576 the number of bytes of bundle data that are transmitted in this 577 segment. Following this length is the actual data contents. 579 Determining the size of the segment is an implementation matter. In 580 particular, a node may, based on local policy or configuration, only 581 ever transmit bundle data in a single segment, in which case both the 582 'S' and 'E' bits MUST be set to one. However, if a node is able to 583 receive, over TCP, a bundle of size X with segment size Y, then it 584 MUST also be able to do it with any segment size <= X. 586 In the Bundle Protocol specification, a single bundle comprises a 587 primary bundle block, a payload block, and zero or more additional 588 bundle blocks. The relationship between the protocol blocks and the 589 convergence layer segments is an implementation-specific decision. 590 In particular, a segment MAY contain more than one protocol block; 591 alternatively, a single protocol block (such as the payload) MAY be 592 split into multiple segments. 594 However, a single segment MUST NOT contain data of more than a single 595 bundle. 597 Once a transmission of a bundle has commenced, the node MUST only 598 send segments containing sequential portions of that bundle until it 599 sends a segment with the 'E' bit set. 601 5.3. Bundle Acknowledgments (ACK_SEGMENT) 603 Although the TCP transport provides reliable transfer of data between 604 transport peers, the typical BSD sockets interface provides no means 605 to inform a sending application of when the receiving application has 606 processed some amount of transmitted data. Thus after transmitting 607 some data, a Bundle Protocol agent needs an additional mechanism to 608 determine whether the receiving agent has successfully received the 609 segment. 611 To this end, the TCPCL protocol offers an optional feature whereby a 612 receiving node transmits acknowledgments of reception of data 613 segments. This feature is enabled if and only if during the exchange 614 of contact headers, both parties set the flag to indicate that 615 segment acknowledgments are enabled (see Section 4.1). If so, then 616 the receiver MUST transmit a bundle acknowledgment message when it 617 successfully receives each data segment. 619 The format of a bundle acknowledgment is as follows: 621 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 622 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 623 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 624 | 0x2 |0|0|0|0| acknowledged length ... | 625 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 627 Figure 5: Format of bundle acknowledgement messages 629 To transmit an acknowledgment, a node first transmits a message 630 header with the ACK_SEGMENT type code and all flags set to zero, then 631 transmits an SDNV containing the cumulative length in bytes of the 632 received segment(s) of the current bundle. The length MUST fall on a 633 segment boundary. That is, only full segments can be acknowledged. 635 For example, suppose the sending node transmits four segments of 636 bundle data with lengths 100, 200, 500, and 1000 respectively. After 637 receiving the first segment, the node sends an acknowledgment of 638 length 100. After the second segment is received, the node sends an 639 acknowledgment of length 300. The third and fourth acknowledgments 640 are of length 800 and 1800 respectively. 642 5.4. Bundle Refusal (REFUSE_BUNDLE) 644 As bundles may be large, the TCPCL supports an optional mechanisms by 645 which a receiving node may indicate to the sender that it does not 646 want to receive the corresponding bundle. 648 To do so, upon receiving a DATA_SEGMENT message, the node MAY 649 transmit a REFUSE_BUNDLE message. As data segments and 650 acknowledgments may cross on the wire, the bundle that is being 651 refused is implicitly identified by the sequence in which 652 acknowledgements and refusals are received. 654 The format of the REFUSE_BUNDLE message is as follows: 656 0 1 2 3 4 5 6 7 657 +-+-+-+-+-+-+-+-+ 658 | 0x3 | RCode | 659 +-+-+-+-+-+-+-+-+ 661 Figure 6: Format of REFUSE_BUNDLE message 663 The RCode field, which stands for "reason code", contains a value 664 indicating why the bundle was refused. The following table contains 665 semantics for some values. Other values may be registered with IANA, 666 as defined in Section 8. 668 +-----------+-------------------------------------------------------+ 669 | RCode | Semantics | 670 +-----------+-------------------------------------------------------+ 671 | 0x0 | Reason for refusal is unknown or not specified. | 672 | 0x1 | The receiver now has the complete bundle. The sender | 673 | | may now consider the bundle as completely received. | 674 | 0x2 | The receiver's resources are exhausted. The sender | 675 | | SHOULD apply reactive bundle fragmentation before | 676 | | retrying. | 677 | 0x3 | The receiver has encountered a problem that requires | 678 | | the bundle to be retransmitted in its entirety. | 679 | 0x4-0x7 | Unassigned. | 680 | 0x8-0xf | Reserved for future usage. | 681 +-----------+-------------------------------------------------------+ 683 Table 3: REFUSE_BUNDLE Reason Codes 685 The receiver MUST, for each bundle preceding the one to be refused, 686 have either acknowledged all DATA_SEGMENTs or refused the bundle. 687 This allows the sender to identify the bundles accepted and refused 688 by means of a simple FIFO list of segments and acknowledgments. 690 The bundle refusal MAY be sent before the entire data segment is 691 received. If a sender receives a REFUSE_BUNDLE message, the sender 692 MUST complete the transmission of any partially-sent DATA_SEGMENT 693 message (so that the receiver stays in sync). The sender MUST NOT 694 commence transmission of any further segments of the rejected bundle 695 subsequently. Note, however, that this requirement does not ensure 696 that a node will not receive another DATA_SEGMENT for the same bundle 697 after transmitting a REFUSE_BUNDLE message since messages may cross 698 on the wire; if this happens, subsequent segments of the bundle 699 SHOULD be refused with a REFUSE_BUNDLE message, too. 701 Note: If a bundle transmission if aborted in this way, the receiver 702 may not receive a segment with the 'E' flag set to '1' for the 703 aborted bundle. The beginning of the next bundle is identified by 704 the 'S' bit set to '1', indicating the start of a new bundle. 706 5.5. Bundle Length (LENGTH) 708 The LENGTH message contains the total length, in bytes, of the next 709 bundle, formatted as an SDNV. Its purpose is to allow nodes to 710 preemptively refuse bundles that would exceed their resources. It is 711 an optimization. 713 The format of the LENGTH message is as follows: 715 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 716 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 717 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 718 | 0x6 |0|0|0|0| total bundle length ... | 719 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 721 Figure 7: Format of LENGTH messages 723 LENGTH messages MUST NOT be sent unless the corresponding flag bit is 724 set in the contact header. If the flag bit is set, LENGTH messages 725 MAY be sent, at the sender's discretion. LENGTH messages MUST NOT be 726 sent unless the next DATA_SEGMENT message has the S bit set to 1 727 (i.e., just before the start of a new bundle). 729 A receiver MAY send a BUNDLE_REFUSE message as soon as it receives a 730 LENGTH message, without waiting for the next DATA_SEGMENT message. 731 The receiver MUST be prepared for this and MUST associate the refusal 732 with the right bundle. 734 5.6. Keepalive Messages (KEEPALIVE) 736 The protocol includes a provision for transmission of keepalive 737 messages over the TCP connection to help determine if the connection 738 has been disrupted. 740 As described in Section 4.1, one of the parameters in the contact 741 header is the keepalive_interval. Both sides populate this field 742 with their requested intervals (in seconds) between keepalive 743 messages. 745 The format of a keepalive message is a one byte message type code of 746 KEEPALIVE (as described in Table 2, with no additional data. Both 747 sides SHOULD send a keepalive message whenever the negotiated 748 interval has elapsed with no transmission of any message (keepalive 749 or other). 751 If no message (keepalive or other) has been received for at least 752 twice the keepalive interval, then either party MAY terminate the 753 session by transmitting a one byte SHUTDOWN message (as described in 754 Table 2) and by closing the TCP connection. 756 Note: The keepalive interval should not be chosen too short as TCP 757 retransmissions may occur in case of packet loss. Those will have to 758 be triggered by a timeout (TCP RTO) which is dependent on the 759 measured RTT for the TCP connection so that keepalive message may 760 experience noticeable latency. 762 6. Connection Termination 764 This section describes the procedures for ending a TCPCL connection. 766 6.1. Shutdown Message (SHUTDOWN) 768 To cleanly shut down a connection, a SHUTDOWN message MUST be 769 transmitted by either node at any point following complete 770 transmission of any other message. In case acknowledgments have been 771 negotiated, a node SHOULD acknowledge all received data segments 772 first and then shut down the connection. 774 The format of the shutdown message is as follows: 776 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 777 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 778 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 779 | 0x5 |0|0|R|D| reason (opt) | reconnection delay (opt) | 780 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 782 Figure 8: Format of bundle shutdown messages 784 It is possible for a node to convey additional information regarding 785 the reason for connection termination. To do so, the node MUST set 786 the 'R' bit in the message header flags, and transmit a one-byte 787 reason code immediately following the message header. The specified 788 values of the reason code are: 790 +---------------+---------------+-----------------------------------+ 791 | Code | Meaning | Description | 792 +---------------+---------------+-----------------------------------+ 793 | 0x00 | Idle timeout | The connection is being closed | 794 | | | due to idleness. | 795 | | | | 796 | 0x01 | Version | The node cannot conform to the | 797 | | mismatch | specified TCPCL protocol version. | 798 | | | | 799 | 0x02 | Busy | The node is too busy to handle | 800 | | | the current connection. | 801 | 0x03-0xff | | Unassigned. | 802 +---------------+---------------+-----------------------------------+ 804 Table 4: Shutdown Reason Codes 806 It is also possible to convey a requested reconnection delay to 807 indicate how long the other node must wait before attempting 808 connection re-establishment. To do so, the node sets the 'D' bit in 809 the message header flags, then transmits an SDNV specifying the 810 requested delay, in seconds, following the message header (and 811 optionally the shutdown reason code). The value 0 SHALL be 812 interpreted as an infinite delay, i.e., that the connecting node MUST 813 NOT re-establish the connection. In contrast, if the node does not 814 wish to request a delay, it SHOULD omit the delay field (and set the 815 'D' bit to zero). Note that in the figure above, a two octet SDNV is 816 shown for convenience of the presentation. 818 A connection shutdown MAY occur immediately after TCP connection 819 establishment or reception of a contact header (and prior to any 820 further data exchange). This may, for example, be used to notify 821 that the node is currently not able or willing to communicate. 822 However, a node MUST always send the contact header to its peer 823 before sending a SHUTDOWN message. 825 If either node terminates a connection prematurely in this manner, it 826 SHOULD send a SHUTDOWN message and MUST indicate a reason code unless 827 the incoming connection did not include the magic string. If a node 828 does not want its peer to re-open the connection immediately, it 829 SHOULD set the 'D' bit in the flags and include a reconnection delay 830 to indicate when the peer is allowed to attempt another connection 831 setup. 833 If a connection is to be terminated before another protocol message 834 has completed, then the node MUST NOT transmit the SHUTDOWN message 835 but still SHOULD close the TCP connection. In particular, if the 836 connection is to be closed (for whatever reason) while a node is in 837 the process of transmitting a bundle data segment, receiving node is 838 still expecting segment data and might erroneously interpret the 839 SHUTDOWN message to be part of the data segment. 841 6.2. Idle Connection Shutdown 843 The protocol includes a provision for clean shutdown of idle TCP 844 connections. Determining the length of time to wait before closing 845 idle connections, if they are to be closed at all, is an 846 implementation and configuration matter. 848 If there is a configured time to close idle links, then if no bundle 849 data (other than keepalive messages) has been received for at least 850 that amount of time, then either node MAY terminate the connection by 851 transmitting a SHUTDOWN message indicating the reason code of 'idle 852 timeout' (as described above). After receiving a SHUTDOWN message in 853 response, both sides may close the TCP connection. 855 7. Security Considerations 856 One security consideration for this protocol relates to the fact that 857 nodes present their endpoint identifier as part of the connection 858 header exchange. It would be possible for a node to fake this value 859 and present the identity of a singleton endpoint in which the node is 860 not a member, essentially masquerading as another DTN node. If this 861 identifier is used without further verification as a means to 862 determine which bundles are transmitted over the connection, then the 863 node that has falsified its identity may be able to obtain bundles 864 that it should not have. Therefore, a node SHALL NOT use the 865 endpoint identifier conveyed in the TCPCL connection message to 866 derive a peer node's entity unless it can ascertain it via other 867 means. 869 These concerns may be mitigated through the use of the Bundle 870 Security Protocol [RFC6257]. In particular, the Bundle 871 Authentication Block defines mechanism for secure exchange of bundles 872 between DTN nodes. Thus an implementation could delay trusting the 873 presented endpoint identifier until the node can securely validate 874 that its peer is in fact the only member of the given singleton 875 endpoint. 877 In general, TCPCL does not provide any security services. The 878 mechanisms defined in [RFC6257] are to be used instead. 880 Nothing in TCPCL prevents the use of the Transport Layer Security 881 (TLS) protocol [RFC5246] to secure a connection. 883 Another consideration for this protocol relates to denial of service 884 attacks. A node may send a large amount of data over a TCP 885 connection, requiring the receiving node to either handle the data, 886 attempt to stop the flood of data by sending a REFUSE_BUNDLE message, 887 or forcibly terminate the connection. This burden could cause denial 888 of service on other, well-behaving connections. There is also 889 nothing to prevent a malicious node from continually establishing 890 connections and repeatedly trying to send copious amounts of bundle 891 data. A listening node MAY take counter-measures such as ignoring 892 TCP SYN messages, closing TCP connections as soon as they are 893 established, waiting before sending the contact header, sending a 894 SHUTDOWN message quickly or with a delay, etc. 896 8. IANA Considerations 898 In this section, registration procedures are as defined in [RFC5226]. 900 8.1. Port Number 902 Port number 4556 has been assigned as the default port for the TCP 903 convergence layer. 905 Service Name: dtn-bundle 907 Transport Protocol(s): TCP 909 Assignee: Simon Perreault 911 Contact: Simon Perreault 913 Description: DTN Bundle TCP CL Protocol 915 Reference: [RFCXXXX] 917 Port Number: 4556 919 8.2. Protocol Versions 921 IANA is asked to create, under the "Bundle Protocol" registry, a sub- 922 registry titled "Bundle Protocol TCP Convergence Layer Version 923 Numbers" and initialize it with the following: 925 +-------+-------------+-----------+ 926 | Value | Description | Reference | 927 +-------+-------------+-----------+ 928 | 0 | Reserved | [RFCXXXX] | 929 | 1 | Reserved | [RFCXXXX] | 930 | 2 | Reserved | [RFCXXXX] | 931 | 3 | TCPCL | [RFCXXXX] | 932 | 4-255 | Unassigned | [RFCXXXX] | 933 +-------+-------------+-----------+ 935 (NOTE TO THE EDITOR: in the above, replace XXXX with this RFC number) 937 The registration procedure shall be RFC Required. 939 8.3. Message Types 941 IANA is asked to create, under the "Bundle Protocol" registry, a sub- 942 registry titled "Bundle Protocol TCP Convergence Layer Message Types" 943 and initialize it with the contents of Table 2. The registration 944 procedure shall be RFC Required. 946 8.4. REFUSE Reason Codes 948 IANA is asked to create, under the "Bundle Protocol" registry, a sub- 949 registry titled "Bundle Protocol TCP Convergence Layer REFUSE Reason 950 Codes" and initialize it with the contents of Table 3. The 951 registration procedure shall be RFC Required. 953 8.5. SHUTDOWN Reason Codes 955 IANA is asked to create, under the "Bundle Protocol" registry, a sub- 956 registry titled "Bundle Protocol TCP Convergence Layer SHUTDOWN 957 Reason Codes" and initialize it with the contents of Table 4. The 958 registration procedure shall be RFC Required. 960 9. Acknowledgements 962 The authors would like to thank the following individuals who have 963 participated in the drafting, review, and discussion of this memo: 964 Alex McMahon, Brenton Walker, Darren Long, Dirk Kutscher, Elwyn 965 Davies, Jean-Philippe Dionne, Joseph Ishac, Keith Scott, Kevin Fall, 966 Lloyd Wood, Marc Blanchet, Peter Lovell, Scott Burleigh, Stephen 967 Farrell, Vint Cerf, and William Ivancic. 969 10. References 971 10.1. Normative References 973 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 974 Requirement Levels", RFC 2119, March 1997. 976 [RFC5050] Scott, K. and S. Burleigh, "Bundle Protocol 977 Specification", RFC 5050, November 2007. 979 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 980 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 981 May 2008. 983 10.2. Informative References 985 [RFC4838] Cerf, V., Burleigh, S., Hooke, A., Torgerson, L., Durst, 986 R., Scott, K., Fall, K., and H. Weiss, "Delay-Tolerant 987 Networking Architecture", RFC 4838, April 2007. 989 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 990 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 992 [RFC6256] Eddy, W. and E. Davies, "Using Self-Delimiting Numeric 993 Values in Protocols", RFC 6256, May 2011. 995 [RFC6257] Symington, S., Farrell, S., Weiss, H., and P. Lovell, 996 "Bundle Security Protocol Specification", RFC 6257, May 997 2011. 999 [refs.dtnimpl] 1000 DTNRG, ., "Delay Tolerant Networking Reference 1001 Implementation", , . 1003 Authors' Addresses 1005 Michael J. Demmer 1006 University of California, Berkeley 1007 Computer Science Division 1008 445 Soda Hall 1009 Berkeley, CA 94720-1776 1010 US 1012 Email: demmer@cs.berkeley.edu 1014 Joerg Ott 1015 Helsinki University of Technology 1016 Department of Communications and Networking 1017 PO Box 3000 1018 TKK 02015 1019 Finland 1021 Email: jo@netlab.tkk.fi 1023 Simon Perreault 1024 Viagenie 1025 246 Aberdeen 1026 Quebec, QC G1R 2E1 1027 Canada 1029 Phone: +1 418 656 9254 1030 Email: simon.perreault@viagenie.ca