idnits 2.17.1 draft-ietf-dtn-tcpclv4-01.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 ([I-D.ietf-dtn-bpbis], [RFC7242]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. == The 'Obsoletes: ' line in the draft header should list only the _numbers_ of the RFCs which will be obsoleted by this document (if approved); it should not include the word 'RFC' in the list. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: Note: The Keepalive Interval SHOULD not be chosen too short as TCP retransmissions MAY occur in case of packet loss. Those will have to be triggered by a timeout (TCP retransmission timeout (RTO)), which is dependent on the measured RTT for the TCP connection so that KEEPALIVE messages MAY experience noticeable latency. -- The document date (November 27, 2016) is 2700 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'I1' is mentioned on line 323, but not defined == Missing Reference: 'L1' is mentioned on line 311, but not defined == Missing Reference: 'L2' is mentioned on line 311, but not defined == Missing Reference: 'L3' is mentioned on line 317, but not defined ** Downref: Normative reference to an Experimental RFC: RFC 5050 ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 7525 (Obsoleted by RFC 9325) == Outdated reference: A later version (-31) exists of draft-ietf-dtn-bpbis-06 == Outdated reference: A later version (-27) exists of draft-ietf-dtn-bpsec-03 Summary: 5 errors (**), 0 flaws (~~), 9 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Delay Tolerant Networking B. Sipos 3 Internet-Draft RKF Engineering 4 Obsoletes: RFC7242 (if approved) M. Demmer 5 Intended status: Standards Track UC Berkeley 6 Expires: May 31, 2017 J. Ott 7 Aalto University 8 S. Perreault 9 November 27, 2016 11 Delay-Tolerant Networking TCP Convergence Layer Protocol Version 4 12 draft-ietf-dtn-tcpclv4-01 14 Abstract 16 This document describes a revised protocol for the TCP-based 17 convergence layer for Delay-Tolerant Networking (DTN). The protocol 18 revision is based on implementation issues in the original [RFC7242] 19 and updates to the Bundle Protocol contents, encodings, and 20 convergence layer requirements in [I-D.ietf-dtn-bpbis]. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on May 31, 2017. 39 Copyright Notice 41 Copyright (c) 2016 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 57 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 4 58 2.1. Definitions Specific to the TCPCL Protocol . . . . . . . 4 59 3. General Protocol Description . . . . . . . . . . . . . . . . 5 60 3.1. Bidirectional Use of TCPCL Sessions . . . . . . . . . . . 6 61 3.2. Example Message Exchange . . . . . . . . . . . . . . . . 6 62 4. Session Establishment . . . . . . . . . . . . . . . . . . . . 7 63 4.1. Contact Header . . . . . . . . . . . . . . . . . . . . . 8 64 4.2. Validation and Parameter Negotiation . . . . . . . . . . 10 65 5. Established Session Operation . . . . . . . . . . . . . . . . 11 66 5.1. Message Type Codes . . . . . . . . . . . . . . . . . . . 11 67 5.2. Upkeep and Status Messages . . . . . . . . . . . . . . . 12 68 5.2.1. Session Upkeep (KEEPALIVE) . . . . . . . . . . . . . 12 69 5.2.2. Message Rejection (REJECT) . . . . . . . . . . . . . 13 70 5.3. Session Security . . . . . . . . . . . . . . . . . . . . 14 71 5.3.1. TLS Handshake Result . . . . . . . . . . . . . . . . 14 72 5.3.2. Example TLS Initiation . . . . . . . . . . . . . . . 15 73 5.4. Bundle Transfer . . . . . . . . . . . . . . . . . . . . . 15 74 5.4.1. Bundle Transfer ID . . . . . . . . . . . . . . . . . 16 75 5.4.2. Bundle Length (LENGTH) . . . . . . . . . . . . . . . 16 76 5.4.3. Bundle Data Transmission (DATA_SEGMENT) . . . . . . . 17 77 5.4.4. Bundle Acknowledgments (ACK_SEGMENT) . . . . . . . . 18 78 5.4.5. Bundle Refusal (REFUSE_BUNDLE) . . . . . . . . . . . 19 79 6. Session Termination . . . . . . . . . . . . . . . . . . . . . 21 80 6.1. Shutdown Message (SHUTDOWN) . . . . . . . . . . . . . . . 21 81 6.2. Idle Session Shutdown . . . . . . . . . . . . . . . . . . 23 82 7. Security Considerations . . . . . . . . . . . . . . . . . . . 23 83 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 84 8.1. Port Number . . . . . . . . . . . . . . . . . . . . . . . 25 85 8.2. Protocol Versions . . . . . . . . . . . . . . . . . . . . 25 86 8.3. Message Types . . . . . . . . . . . . . . . . . . . . . . 26 87 8.4. REFUSE_BUNDLE Reason Codes . . . . . . . . . . . . . . . 26 88 8.5. SHUTDOWN Reason Codes . . . . . . . . . . . . . . . . . . 27 89 8.6. REJECT Reason Codes . . . . . . . . . . . . . . . . . . . 27 90 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 28 91 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 28 92 10.1. Normative References . . . . . . . . . . . . . . . . . . 28 93 10.2. Informative References . . . . . . . . . . . . . . . . . 29 94 Appendix A. Significant changes from RFC7242 . . . . . . . . . . 29 95 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 30 97 1. Introduction 99 This document describes the TCP-based convergence-layer protocol for 100 Delay-Tolerant Networking. Delay-Tolerant Networking is an end-to- 101 end architecture providing communications in and/or through highly 102 stressed environments, including those with intermittent 103 connectivity, long and/or variable delays, and high bit error rates. 104 More detailed descriptions of the rationale and capabilities of these 105 networks can be found in "Delay-Tolerant Network Architecture" 106 [RFC4838]. 108 An important goal of the DTN architecture is to accommodate a wide 109 range of networking technologies and environments. The protocol used 110 for DTN communications is the revised Bundle Protocol (BP) 111 [I-D.ietf-dtn-bpbis], an application-layer protocol that is used to 112 construct a store-and- forward overlay network. As described in the 113 Bundle Protocol specification [I-D.ietf-dtn-bpbis], it requires the 114 services of a "convergence- layer adapter" (CLA) to send and receive 115 bundles using the service of some "native" link, network, or Internet 116 protocol. This document describes one such convergence-layer adapter 117 that uses the well-known Transmission Control Protocol (TCP). This 118 convergence layer is referred to as TCPCL. 120 The locations of the TCPCL and the BP in the Internet model protocol 121 stack are shown in Figure 1. In particular, when BP is using TCP as 122 its bearer with TCPCL as its convergence layer, both BP and TCPCL 123 reside at the application layer of the Internet model. 125 +-------------------------+ 126 | DTN Application | -\ 127 +-------------------------| | 128 | Bundle Protocol (BP) | -> Application Layer 129 +-------------------------+ | 130 | TCP Conv. Layer (TCPCL) | -/ 131 +-------------------------+ 132 | TLS (optional) | ---> Presentation Layer 133 +-------------------------+ 134 | TCP | ---> Transport Layer 135 +-------------------------+ 136 | IP | ---> Network Layer 137 +-------------------------+ 138 | Link-Layer Protocol | ---> Link Layer 139 +-------------------------+ 140 | Physical Medium | ---> Physical Layer 141 +-------------------------+ 143 Figure 1: The Locations of the Bundle Protocol and the TCP 144 Convergence-Layer Protocol above the Internet Protocol Stack 146 This document describes the format of the protocol data units passed 147 between entities participating in TCPCL communications. This 148 document does not address: 150 o The format of protocol data units of the Bundle Protocol, as those 151 are defined elsewhere in [RFC5050] and [I-D.ietf-dtn-bpbis]. This 152 includes the concept of bundle fragmentation or bundle 153 encapsulation. The TCPCL transfers bundles as opaque data blocks. 155 o Mechanisms for locating or identifying other bundle nodes within 156 an internet. 158 2. Requirements Language 160 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 161 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 162 document are to be interpreted as described in [RFC2119]. 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 Session: A TCPCL session (as opposed to a TCP connection) is a 173 TCPCL communication relationship between two bundle nodes. The 174 lifetime of a TCPCL session is bound to the lifetime of an 175 underlying TCP connection. Therefore, a TCPCL session is 176 initiated when a bundle node initiates a TCP connection to be 177 established for the purposes of bundle communication. A TCPCL 178 session is terminated when the TCP connection ends, due either to 179 one or both nodes actively terminating the TCP connection or due 180 to network errors causing a failure of the TCP connection. For 181 the remainder of this document, the term "session" without the 182 prefix "TCPCL" refer to a TCPCL session. 184 Session parameters: The session parameters are a set of values used 185 to affect the operation of the TCPCL for a given session. The 186 manner in which these parameters are conveyed to the bundle node 187 and thereby to the TCPCL is implementation dependent. However, 188 the mechanism by which two bundle nodes exchange and negotiate the 189 values to be used for a given session is described in Section 4.2. 191 Transmission: Transmission refers to the procedures and mechanisms 192 (described below) for conveyance of a bundle from one node to 193 another. 195 3. General Protocol Description 197 The service of this protocol is the transmission of DTN bundles over 198 TCP. This document specifies the encapsulation of bundles, 199 procedures for TCP setup and teardown, and a set of messages and node 200 requirements. The general operation of the protocol is as follows. 202 First, one node establishes a TCPCL session to the other by 203 initiating a TCP connection. After setup of the TCP connection is 204 complete, an initial contact header is exchanged in both directions 205 to set parameters of the TCPCL session and exchange a singleton 206 endpoint identifier for each node (not the singleton Endpoint 207 Identifier (EID) of any application running on the node) to denote 208 the bundle-layer identity of each DTN node. This is used to assist 209 in routing and forwarding messages, e.g., to prevent loops. 211 Once the TCPCL session is established and configured in this way, 212 bundles can be transferred in either direction. Each transfer is 213 performed in one or more logical segments of data. Each logical data 214 segment consists of a DATA_SEGMENT message header, a count of the 215 length of the segment, and finally the octet range of the bundle 216 data. The choice of the length to use for segments is an 217 implementation matter (but must be within the Segment MRU size of 218 Section 4.1). The first segment for a bundle MUST set the 'start' 219 flag, and the last one MUST set the 'end' flag in the DATA_SEGMENT 220 message header. 222 If multiple bundles are transmitted on a single TCPCL connection, 223 they MUST be transmitted consecutively. Interleaving data segments 224 from different bundles is not allowed. Bundle interleaving can be 225 accomplished by fragmentation at the BP layer or by establishing 226 multiple TCPCL sessions. 228 A feature of this 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 session is interrupted, it can perform reactive 233 fragmentation to avoid re-sending the already transmitted part of the 234 bundle. For each data segment that is received, the receiving node 235 sends an ACK_SEGMENT code followed by an count containing the 236 cumulative length of the bundle that has been received. The sending 237 node MAY transmit multiple DATA_SEGMENT messages without necessarily 238 waiting for the corresponding ACK_SEGMENT responses. This enables 239 pipelining of messages on a channel. In addition, there is no 240 explicit flow control on the TCPCL layer. 242 Another feature is that a receiver MAY interrupt the transmission of 243 a bundle at any point in time by replying with a REFUSE_BUNDLE 244 message, which causes the sender to stop transmission of the current 245 bundle, after completing transmission of a partially sent data 246 segment. Note: This enables a cross-layer optimization in that it 247 allows a receiver that detects that it already has received a certain 248 bundle to interrupt transmission as early as possible and thus save 249 transmission capacity for other bundles. 251 For sessions that are idle, a KEEPALIVE message is sent at a 252 negotiated interval. This is used to convey liveness information. 254 Finally, before sessions close, a SHUTDOWN message is sent to the 255 session peer. After sending a SHUTDOWN message, the sender of this 256 message MAY send further acknowledgments (ACK_SEGMENT or 257 REFUSE_BUNDLE) but no further data messages (DATA_SEGMENT). A 258 SHUTDOWN message MAY also be used to refuse a session setup by a 259 peer. 261 3.1. Bidirectional Use of TCPCL Sessions 263 There are specific messages for sending and receiving operations (in 264 addition to session setup/teardown). TCPCL is symmetric, i.e., both 265 sides can start sending data segments in a session, and one side's 266 bundle transfer does not have to complete before the other side can 267 start sending data segments on its own. Hence, the protocol allows 268 for a bi-directional mode of communication. 270 Note that in the case of concurrent bidirectional transmission, 271 acknowledgment segments MAY be interleaved with data segments. 273 3.2. Example Message Exchange 275 The following figure visually depicts the protocol exchange for a 276 simple session, showing the session establishment and the 277 transmission of a single bundle split into three data segments (of 278 lengths L1, L2, and L3) from Node A to Node B. 280 Note that the sending node MAY transmit multiple DATA_SEGMENT 281 messages without necessarily waiting for the corresponding 282 ACK_SEGMENT responses. This enables pipelining of messages on a 283 channel. Although this example only demonstrates a single bundle 284 transmission, it is also possible to pipeline multiple DATA_SEGMENT 285 messages for different bundles without necessarily waiting for 286 ACK_SEGMENT messages to be returned for each one. However, 287 interleaving data segments from different bundles is not allowed. 289 No errors or rejections are shown in this example. 291 Node A Node B 292 ====== ====== 293 +-------------------------+ +-------------------------+ 294 | Contact Header | -> <- | Contact Header | 295 +-------------------------+ +-------------------------+ 297 +-------------------------+ 298 | LENGTH | -> 299 | Transfer ID [I1] | 300 | Total Length [L1] | 301 +-------------------------+ 302 +-------------------------+ 303 | DATA_SEGMENT (start) | -> 304 | Transfer ID [I1] | 305 | Length [L1] | 306 | Bundle Data 0..(L1-1) | 307 +-------------------------+ 308 +-------------------------+ +-------------------------+ 309 | DATA_SEGMENT | -> <- | ACK_SEGMENT (start) | 310 | Transfer ID [I1] | | Transfer ID [I1] | 311 | Length [L2] | | Length [L1] | 312 |Bundle Data L1..(L1+L2-1)| +-------------------------+ 313 +-------------------------+ 314 +-------------------------+ +-------------------------+ 315 | DATA_SEGMENT (end) | -> <- | ACK_SEGMENT | 316 | Transfer ID [I1] | | Transfer ID [I1] | 317 | Length [L3] | | Length [L1+L2] | 318 |Bundle Data | +-------------------------+ 319 | (L1+L2)..(L1+L2+L3-1)| 320 +-------------------------+ 321 +-------------------------+ 322 <- | ACK_SEGMENT (end) | 323 | Transfer ID [I1] | 324 | Length [L1+L2+L3] | 325 +-------------------------+ 327 +-------------------------+ +-------------------------+ 328 | SHUTDOWN | -> <- | SHUTDOWN | 329 +-------------------------+ +-------------------------+ 331 Figure 2: A Simple Visual Example of the Flow of Protocol Messages on 332 a Single TCP Session between Two Nodes (A and B) 334 4. Session Establishment 336 For bundle transmissions to occur using the TCPCL, a TCPCL session 337 MUST first be established between communicating nodes. It is up to 338 the implementation to decide how and when session setup is triggered. 340 For example, some sessions MAY be opened proactively and maintained 341 for as long as is possible given the network conditions, while other 342 sessions MAY be opened only when there is a bundle that is queued for 343 transmission and the routing algorithm selects a certain next-hop 344 node. 346 To establish a TCPCL session, a node MUST first establish a TCP 347 connection with the intended peer node, typically by using the 348 services provided by the operating system. Port number 4556 has been 349 assigned by IANA as the well-known port number for the TCP 350 convergence layer. Other port numbers MAY be used per local 351 configuration. Determining a peer's port number (if different from 352 the well-known TCPCL port) is up to the implementation. 354 If the node is unable to establish a TCP connection for any reason, 355 then it is an implementation matter to determine how to handle the 356 connection failure. A node MAY decide to re-attempt to establish the 357 connection. If it does so, it MUST NOT overwhelm its target with 358 repeated connection attempts. Therefore, the node MUST retry the 359 connection setup only after some delay (a 1-second minimum is 360 RECOMMENDED), and it SHOULD use a (binary) exponential backoff 361 mechanism to increase this delay in case of repeated failures. In 362 case a SHUTDOWN message specifying a reconnection delay is received, 363 that delay is used as the initial delay. The default initial delay 364 SHOULD be at least 1 second but SHOULD be configurable since it will 365 be application and network type dependent. 367 The node MAY declare failure after one or more connection attempts 368 and MAY attempt to find an alternate route for bundle data. Such 369 decisions are up to the higher layer (i.e., the BP). 371 Once a TCP connection is established, each node MUST immediately 372 transmit a contact header over the TCP connection. The format of the 373 contact header is described in Section 4.1. 375 Upon receipt of the contact header, both nodes perform the validation 376 and negotiation procedures defined in Section 4.2 378 After receiving the contact header from the other node, either node 379 MAY also refuse the session by sending a SHUTDOWN message. If 380 session setup is refused, a reason MUST be included in the SHUTDOWN 381 message. 383 4.1. Contact Header 385 Once a TCP connection is established, both parties exchange a contact 386 header. This section describes the format of the contact header and 387 the meaning of its fields. 389 The format for the Contact Header is as follows: 391 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 392 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 393 +---------------+---------------+---------------+---------------+ 394 | magic='dtn!' | 395 +---------------+---------------+---------------+---------------+ 396 | Version | Flags | Keepalive Interval | 397 +---------------+---------------+---------------+---------------+ 398 | Segment MRU... | 399 +---------------+---------------+---------------+---------------+ 400 | contd. | 401 +---------------+---------------+---------------+---------------+ 402 | Transfer MRU... | 403 +---------------+---------------+---------------+---------------+ 404 | contd. | 405 +---------------+---------------+---------------+---------------+ 406 | EID Length | EID Data... | 407 +---------------+---------------+---------------+---------------+ 408 | contd. | 409 +---------------+---------------+---------------+---------------+ 411 Figure 3: Contact Header Format 413 The fields of the contact header are: 415 magic: A four-octet field that always contains the octet sequence 416 0x64 0x74 0x6e 0x21, i.e., the text string "dtn!" in US-ASCII (and 417 UTF-8). 419 Version: A one-octet field value containing the value 4 (current 420 version of the protocol). 422 Flags: A one-octet field of single-bit flags, interpreted according 423 to the descriptions in Table 1. 425 Keepalive Interval: A 16-bit unsigned integer indicating the longest 426 allowable interval in seconds between KEEPALIVE messages received 427 in this session. 429 Segment MRU: A 64-bit unsigned integer indicating the largest 430 allowable single-segment data payload size to be received in this 431 session. Any DATA_SEGMENT sent to this peer SHALL have a data 432 payload no longer than the peer's Segment MRU. The two endpoints 433 of a single session MAY have different Segment MRUs, and no 434 relation between the two is required. 436 Transfer MRU: A 64-bit unsigned integer indicating the largest 437 allowable total-bundle data size to be received in this session. 438 Any bundle transfer sent to this peer SHALL have a Total bundle 439 data payload no longer than the peer's Transfer MRU. This value 440 can be used to perform proactive bundle fragmentation. The two 441 endpoints of a single session MAY have different Transfer MRUs, 442 and no relation between the two is required. 444 EID Length and EID Data: Together these fields represent a variable- 445 length text string. The EID Length is a 16-bit unsigned integer 446 indicating the number of octets of EID Data to follow. A zero EID 447 Length is a special case which indicates the lack of EID rather 448 than a truly empty EID. A non-zero-length EID Data contains the 449 UTF-8 encoded EID of some singleton endpoint in which the sending 450 node is a member, in the canonical format of :. 453 +---------+------+--------------------------------------------------+ 454 | Type | Code | Description | 455 +---------+------+--------------------------------------------------+ 456 | CAN_TLS | 0x01 | If bit is set, indicates that the sending peer | 457 | | | is capable of TLS security. | 458 +---------+------+--------------------------------------------------+ 460 Table 1: Contact Header Flags 462 4.2. Validation and Parameter Negotiation 464 Upon reception of the contact header, each node follows the following 465 procedures to ensure the validity of the TCPCL session and to 466 negotiate values for the session parameters. 468 If the magic string is not present or is not valid, the connection 469 MUST be terminated. The intent of the magic string is to provide 470 some protection against an inadvertent TCP connection by a different 471 protocol than the one described in this document. To prevent a flood 472 of repeated connections from a misconfigured application, a node MAY 473 elect to hold an invalid connection open and idle for some time 474 before closing it. 476 If a node receives a contact header containing a version that is 477 greater than the current version of the protocol that the node 478 implements, then the node SHALL shutdown the session with a reason 479 code of "Version mismatch". If a node receives a contact header with 480 a version that is lower than the version of the protocol that the 481 node implements, the node MAY either terminate the session (with a 482 reason code of "Version mismatch"). Otherwise, the node MAY adapt 483 its operation to conform to the older version of the protocol. This 484 decision is an implementation matter. 486 A node calculates the parameters for a TCPCL session by negotiating 487 the values from its own preferences (conveyed by the contact header 488 it sent to the peer) with the preferences of the peer node (expressed 489 in the contact header that it received from the peer). The 490 negotatiated parameters defined by this specification are described 491 in the following paragraphs. 493 Session Keepalive: Negotiation of the Session Keepalive parameter is 494 performed by taking the minimum of this two contact headers' 495 Keepalive Interval. If the negotiated Session Keepalive is zero 496 (i.e. one or both contact headers contains a zero Keepalive 497 Interval), then the keepalive feature (described in Section 5.2.1) 498 is disabled. 500 Enable TLS: Negotiation of the Enable TLS parameter is performed by 501 taking the logical AND of the two contact headers' CAN_TLS flags. 502 If the negotiated Enable TLS value is true then TLS negotiation 503 feature (described in Section 5.3) begins immediately following 504 the contact header exchange. 506 Once this process of parameter negotiation is completed, the protocol 507 defines no additional mechanism to change the parameters of an 508 established session; to effect such a change, the session MUST be 509 terminated and a new session established. 511 5. Established Session Operation 513 This section describes the protocol operation for the duration of an 514 established session, including the mechanism for transmitting bundles 515 over the session. 517 5.1. Message Type Codes 519 After the initial exchange of a contact header, all messages 520 transmitted over the session are identified by a one-octet header 521 with the following structure: 523 0 1 2 3 4 5 6 7 524 +-+-+-+-+-+-+-+-+ 525 | type | flags | 526 +-+-+-+-+-+-+-+-+ 528 Figure 4: Format of the One-Octet Message Header 530 type: Indicates the type of the message as per Table 2 below. 532 flags: Optional flags defined based on message type. 534 The types and values for the message type code are as follows. 536 +---------------+------+--------------------------------------------+ 537 | Type | Code | Description | 538 +---------------+------+--------------------------------------------+ 539 | DATA_SEGMENT | 0x1 | Indicates the transmission of a segment of | 540 | | | bundle data, as described in Section | 541 | | | 5.4.3. | 542 | | | | 543 | ACK_SEGMENT | 0x2 | Acknowledges reception of a data segment, | 544 | | | as described in Section 5.4.4. | 545 | | | | 546 | REFUSE_BUNDLE | 0x3 | Indicates that the transmission of the | 547 | | | current bundle SHALL be stopped, as | 548 | | | described in Section 5.4.5. | 549 | | | | 550 | KEEPALIVE | 0x4 | KEEPALIVE message for the session, as | 551 | | | described in Section 5.2.1. | 552 | | | | 553 | SHUTDOWN | 0x5 | Indicates that one of the nodes | 554 | | | participating in the session wishes to | 555 | | | cleanly terminate the session, as | 556 | | | described in Section 6. | 557 | | | | 558 | LENGTH | 0x6 | Contains the length (in octets) of the | 559 | | | next bundle, as described in Section | 560 | | | 5.4.2. | 561 | | | | 562 | REJECT | TBD | Contains a TCPCL message rejection, as | 563 | | | described in Section 5.2.2. | 564 +---------------+------+--------------------------------------------+ 566 Table 2: TCPCL Message Types 568 5.2. Upkeep and Status Messages 570 5.2.1. Session Upkeep (KEEPALIVE) 572 The protocol includes a provision for transmission of KEEPALIVE 573 messages over the TCPCL session to help determine if the underlying 574 TCP connection has been disrupted. 576 As described in Section 4.1, one of the parameters in the contact 577 header is the Keepalive Interval. Both sides populate this field 578 with their requested intervals (in seconds) between KEEPALIVE 579 messages. 581 The format of a KEEPALIVE message is a one-octet message type code of 582 KEEPALIVE (as described in Table 2) with no additional data. Both 583 sides SHOULD send a KEEPALIVE message whenever the negotiated 584 interval has elapsed with no transmission of any message (KEEPALIVE 585 or other). 587 If no message (KEEPALIVE or other) has been received for at least 588 twice the Keepalive Interval, then either party MAY terminate the 589 session by transmitting a one-octet SHUTDOWN message (as described in 590 Table 2, with reason code "Idle Timeout") and by closing the session. 592 Note: The Keepalive Interval SHOULD not be chosen too short as TCP 593 retransmissions MAY occur in case of packet loss. Those will have to 594 be triggered by a timeout (TCP retransmission timeout (RTO)), which 595 is dependent on the measured RTT for the TCP connection so that 596 KEEPALIVE messages MAY experience noticeable latency. 598 5.2.2. Message Rejection (REJECT) 600 If a TCPCL endpoint receives a message which is unknown to it 601 (possibly due to an unhandled protocol mismatch) or is inappropriate 602 for the current session state (e.g. a KEEPALIVE message received 603 after contact header negotation has disabled that feature), there is 604 a protocol-level message to signal this condition in the form of a 605 REJECT reply. 607 The format of a REJECT message follows: 609 +-----------------------------+ 610 | Message Header | 611 +-----------------------------+ 612 | Reason Code (U8) | 613 +-----------------------------+ 614 | Rejected Message Header | 615 +-----------------------------+ 617 Figure 5: Format of REJECT Messages 619 The Rejected Message Header is a copy of the Message Header to which 620 the REJECT message is sent as a response. The REJECT Reason Code is 621 an 8-bit unsigned integer and indicates why the REJECT itself was 622 sent. The specified values of the reason code are: 624 +-------------+------+----------------------------------------------+ 625 | Name | Code | Description | 626 +-------------+------+----------------------------------------------+ 627 | Message | 0x01 | A message was received with a Message Type | 628 | Type | | code unknown to the TCPCL endpoint. | 629 | Unknown | | | 630 | | | | 631 | Message | 0x02 | A message was received but the TCPCL | 632 | Unsupported | | endpoint cannot comply with the message | 633 | | | contents. | 634 | | | | 635 | Message | 0x03 | A message was received while the session is | 636 | Unexpected | | in a state in which the message is not | 637 | | | expected. | 638 +-------------+------+----------------------------------------------+ 640 Table 3: REJECT Reason Codes 642 5.3. Session Security 644 This version of the TCPCL supports establishing a session-level 645 Transport Layer Security (TLS) session within an existing TCPCL 646 session. Negotation of whether or not to initiate TLS within TCPCL 647 session is part of the contact header as described in Section 4.2. 649 When TLS is used within the TCPCL it affects the entire session. By 650 convention, this protocol uses the endpoint which initiated the 651 underlying TCP connection as the "client" role of the TLS handshake 652 request. Once a TLS session is established within TCPCL, there is no 653 mechanism provided to end the TLS session and downgrade the session. 654 If a non-TLS session is desired after a TLS session is started then 655 the entire TCPCL session MUST be shutdown first. 657 After negotiating an Enable TLS parameter of true, and before any 658 other TCPCL messages are sent within the session, the session 659 endpoints SHALL begin a TLS handshake in accordance with [RFC5246]. 660 The parameters within each TLS negotation are implementation 661 dependent but any TCPCL endpoint SHOULD follow all recommended best 662 practices of [RFC7525]. 664 5.3.1. TLS Handshake Result 666 If a TLS handshake cannot negotiate a TLS session, both endpoints of 667 the TCPCL session SHALL cause a TCPCL shutdown with reason "TLS 668 negotiation failed". 670 After a TLS session is successfuly established, both TCPCL endpoints 671 SHALL re-exchange TCPCL Contact Header messages. Any information 672 cached from the prior Contact Header exchange SHALL be discarded. 673 This re-exchange avoids man-in-the-middle attack in identical fashion 674 to [RFC2595]. 676 5.3.2. Example TLS Initiation 678 A summary of a typical CAN_TLS usage is shown in the sequence in 679 Figure 6 below. 681 Node A Node B 682 ====== ====== 684 +-------------------------+ 685 | Open TCP Connnection | -> 686 +-------------------------+ +-------------------------+ 687 <- | Accept Connection | 688 +-------------------------+ 690 +-------------------------+ +-------------------------+ 691 | Contact Header | -> <- | Contact Header | 692 +-------------------------+ +-------------------------+ 694 +-------------------------+ +-------------------------+ 695 | TLS Negotiation | -> <- | TLS Negotiation | 696 | (as client) | | (as server) | 697 +-------------------------+ +-------------------------+ 699 +-------------------------+ +-------------------------+ 700 | Contact Header | -> <- | Contact Header | 701 +-------------------------+ +-------------------------+ 703 ... secured TCPCL messaging ... 705 +-------------------------+ +-------------------------+ 706 | SHUTDOWN | -> <- | SHUTDOWN | 707 +-------------------------+ +-------------------------+ 709 Figure 6: A simple visual example of TCPCL TLS Establishment between 710 two nodes 712 5.4. Bundle Transfer 714 All of the message in this section are directly associated with 715 tranfering a bundle between TCPCL endpoints. 717 A single TCPCL transfer results in a bundle (handled by the 718 convergence layer as opaque data) being exchanged from one endpoint 719 to the other. In TCPCL a transfer is accomplished by dividing a 720 single bundle up into "segments" based on the receving-side Segment 721 MRU (see Section 4.1). 723 A single transfer (and by extension a single segment) SHALL NOT 724 contain data of more than a single bundle. This requirement is 725 imposed on the agent using the TCPCL rather than TCPCL itself. 727 5.4.1. Bundle Transfer ID 729 Each of the bundle transfer messages contains a Transfer ID number 730 which is used to correlate messages originating from sender and 731 receiver of a bundle. A Transfer ID does not attempt to address 732 uniqueness of the bundle data itself and has no relation to concepts 733 such as bundle fragmentation. Each invocation of TCPCL by the bundle 734 protocol agent, requesting transmission of a bundle (fragmentary or 735 otherwise), results in the initiation of a single TCPCL transfer. 736 Each transfer entails the sending of a LENGTH message and some number 737 of DATA_SEGMENT and ACK_SEGMENT messages; all are correlated by the 738 same Transfer ID. 740 Transfer IDs from each endpoint SHALL be unique within a single TCPCL 741 session. The initial Transfer ID from each endpoint SHALL have value 742 zero. Subsequent Transfer ID values SHALL be incremented from the 743 prior Transfer ID value by one. Upon exhaustion of the entire 64-bit 744 Transfer ID space, the sending endpoint SHALL terminate the session 745 with SHUTDOWN reason code "Resource Exhaustion". 747 For bidirectional bundle transfers, a TCPCL endpoint SHOULD NOT rely 748 on any relation between Transfer IDs originating from each side of 749 the TCPCL session. 751 5.4.2. Bundle Length (LENGTH) 753 The LENGTH message contains the total length, in octets, of the 754 bundle data in the associated transfer. The total length is 755 formatted as a 64-bit unsigned integer. 757 The purpose of the LENGTH message is to allow nodes to preemptively 758 refuse bundles that would exceed their resources or to prepare 759 storage on the receiving node for the upcoming bundle data. See 760 Section 5.4.5 for details on when refusal based on LENGTH content is 761 acceptable. 763 The Total Bundle Length field within a LENGTH message SHALL be used 764 as informative data by the receiver. If, for whatever reason, the 765 actual total length of bundle data received differs from the value 766 indicated by the LENGTH message, the receiver SHOULD accept the full 767 set of bundle data as valid. 769 The format of the LENGTH message is as follows: 771 +-----------------------------+ 772 | Message Header | 773 +-----------------------------+ 774 | Transfer ID (U64) | 775 +-----------------------------+ 776 | Total bundle length (U64) | 777 +-----------------------------+ 779 Figure 7: Format of LENGTH Messages 781 LENGTH messages SHALL be sent immediately before transmission of any 782 DATA_SEGMENT messages. LENGTH messages MUST NOT be sent unless the 783 next DATA_SEGMENT message has the 'S' bit set to "1" (i.e., just 784 before the start of a new transfer). 786 A receiver MAY send a BUNDLE_REFUSE message as soon as it receives a 787 LENGTH message without waiting for the next DATA_SEGMENT message. 788 The sender MUST be prepared for this and MUST associate the refusal 789 with the correct bundle via the Transfer ID fields. 791 Upon reception of a LENGTH message not immediately before the start 792 of a starting DATA_SEGMENT the reciever SHALL send a REJECT message 793 with a Reason Code of "Message Unexpected". 795 5.4.3. Bundle Data Transmission (DATA_SEGMENT) 797 Each bundle is transmitted in one or more data segments. The format 798 of a DATA_SEGMENT message follows in Figure 8 and its use of header 799 flags is shown in Figure 9. 801 +------------------------------+ 802 | Message Header | 803 +------------------------------+ 804 | Transfer ID (U64) | 805 +------------------------------+ 806 | Data length (U64) | 807 +------------------------------+ 808 | Data contents (octet string) | 809 +------------------------------+ 811 Figure 8: Format of DATA_SEGMENT Messages 812 4 5 6 7 813 +-+-+-+-+ 814 |0|0|S|E| 815 +-+-+-+-+ 817 Figure 9: Format of DATA_SEGMENT Header flags 819 The flags portion of the message header octet contains two optional 820 values in the two low-order bits, denoted 'S' and 'E' in Figure 9. 821 The 'S' bit MUST be set to one if it precedes the transmission of the 822 first segment of a transfer. The 'E' bit MUST be set to one when 823 transmitting the last segment of a transfer. In the case where an 824 entire transfer is accomplished in a single segment, both the 'S' and 825 'E' bits MUST be set to one. 827 Following the message header, the length field is a 64-bit unsigned 828 integer containing the number of octets of bundle data that are 829 transmitted in this segment. Following the length are the actual 830 data contents. 832 Once a transfer of a bundle has commenced, the node MUST only send 833 segments containing sequential portions of that bundle until it sends 834 a segment with the 'E' bit set. No interleaving of multiple 835 transfers from the same endpoint is possible (within a single TCPCL 836 session). 838 5.4.4. Bundle Acknowledgments (ACK_SEGMENT) 840 Although the TCP transport provides reliable transfer of data between 841 transport peers, the typical BSD sockets interface provides no means 842 to inform a sending application of when the receiving application has 843 processed some amount of transmitted data. Thus, after transmitting 844 some data, a Bundle Protocol agent needs an additional mechanism to 845 determine whether the receiving agent has successfully received the 846 segment. To this end, the TCPCL protocol provides feedback messaging 847 whereby a receiving node transmits acknowledgments of reception of 848 data segments. 850 The format of an ACK_SEGMENT message follows in Figure 10 and its use 851 of header flags is the same as for DATA_SEGMENT (shown in Figure 9). 852 The flags of an ACK_SEGMENT message SHALL be identical to the flags 853 of the DATA_SEGMENT message for which it is a reply. 855 +-----------------------------+ 856 | Message Header | 857 +-----------------------------+ 858 | Transfer ID (U64) | 859 +-----------------------------+ 860 | Acknowledged length (U64) | 861 +-----------------------------+ 863 Figure 10: Format of ACK_SEGMENT Messages 865 A receving TCPCL endpoing SHALL send an ACK_SEGMENT message in 866 response to each received DATA_SEGMENT message. The flags portion of 867 the ACK_SEGMENT header SHALL be set to match the corresponding 868 DATA_SEGEMNT message being acknowledged. The acknowledged length of 869 each ACK_SEGMENT contains the sum of the data length fields of all 870 DATA_SEGMENT messages received so far in the course of the indicated 871 transfer. 873 For example, suppose the sending node transmits four segments of 874 bundle data with lengths 100, 200, 500, and 1000, respectively. 875 After receiving the first segment, the node sends an acknowledgment 876 of length 100. After the second segment is received, the node sends 877 an acknowledgment of length 300. The third and fourth 878 acknowledgments are of length 800 and 1800, respectively. 880 5.4.5. Bundle Refusal (REFUSE_BUNDLE) 882 As bundles can be large, the TCPCL supports an optional mechanism by 883 which a receiving node MAY indicate to the sender that it does not 884 want to receive the corresponding bundle. 886 To do so, upon receiving a LENGTH or DATA_SEGMENT message, the node 887 MAY transmit a REFUSE_BUNDLE message. As data segments and 888 acknowledgments MAY cross on the wire, the bundle that is being 889 refused SHALL be identified by the Transfer ID of the refusal. 891 There is no required relation between the Transfer MRU of a TCPCL 892 endpoint (which is supposed to represent a firm limitation of what 893 the endpoint will accept) and sending of a REFUSE_BUNDLE message. A 894 REFUSE_BUNDLE can be used in cases where the agent's bundle storage 895 is temporarily depleted or somehow constrained. A REFUSE_BUNDLE can 896 also be used after the bundle header or any bundle data is inspected 897 by an agent and determined to be unacceptable. 899 The format of the REFUSE_BUNDLE message is as follows: 901 +-----------------------------+ 902 | Message Header | 903 +-----------------------------+ 904 | Transfer ID (U64) | 905 +-----------------------------+ 907 Figure 11: Format of REFUSE_BUNDLE Messages 909 4 5 6 7 910 +-+-+-+-+ 911 | RCode | 912 +-+-+-+-+ 914 Figure 12: Format of REFUSE_BUNDLE Header flags 916 The RCode field, which stands for "reason code", contains a value 917 indicating why the bundle was refused. The following table contains 918 semantics for some values. Other values MAY be registered with IANA, 919 as defined in Section 8. 921 +------------+-------+----------------------------------------------+ 922 | Name | RCode | Semantics | 923 +------------+-------+----------------------------------------------+ 924 | Unknown | 0x0 | Reason for refusal is unknown or not | 925 | | | specified. | 926 | | | | 927 | Completed | 0x1 | The receiver now has the complete bundle. | 928 | | | The sender MAY now consider the bundle as | 929 | | | completely received. | 930 | | | | 931 | No | 0x2 | The receiver's resources are exhausted. The | 932 | Resources | | sender SHOULD apply reactive bundle | 933 | | | fragmentation before retrying. | 934 | | | | 935 | Retransmit | 0x3 | The receiver has encountered a problem that | 936 | | | requires the bundle to be retransmitted in | 937 | | | its entirety. | 938 +------------+-------+----------------------------------------------+ 940 Table 4: REFUSE_BUNDLE Reason Codes 942 The receiver MUST, for each transfer preceding the one to be refused, 943 have either acknowledged all DATA_SEGMENTs or refused the bundle 944 transfer. 946 The bundle transfer refusal MAY be sent before an entire data segment 947 is received. If a sender receives a REFUSE_BUNDLE message, the 948 sender MUST complete the transmission of any partially sent 949 DATA_SEGMENT message. There is no way to interrupt an individual 950 TCPCL message partway through sending it. The sender MUST NOT 951 commence transmission of any further segments of the refused bundle 952 subsequently. Note, however, that this requirement does not ensure 953 that a node will not receive another DATA_SEGMENT for the same bundle 954 after transmitting a REFUSE_BUNDLE message since messages MAY cross 955 on the wire; if this happens, subsequent segments of the bundle 956 SHOULD also be refused with a REFUSE_BUNDLE message. 958 Note: If a bundle transmission is aborted in this way, the receiver 959 MAY not receive a segment with the 'E' flag set to '1' for the 960 aborted bundle. The beginning of the next bundle is identified by 961 the 'S' bit set to '1', indicating the start of a new transfer, and 962 with a distinct Transfer ID value. 964 6. Session Termination 966 This section describes the procedures for ending a TCPCL session. 968 6.1. Shutdown Message (SHUTDOWN) 970 To cleanly shut down a session, a SHUTDOWN message MUST be 971 transmitted by either node at any point following complete 972 transmission of any other message. A receiving node SHOULD 973 acknowledge all received data segments before sending a SHUTDOWN 974 message to end the session. A transmitting node SHALL treat a 975 SHUTDOWN message received mid-transfer (i.e. before the final 976 acknowledgement) as a failure of the transfer. 978 The format of the SHUTDOWN message is as follows: 980 +-----------------------------------+ 981 | Message Header | 982 +-----------------------------------+ 983 | Reason Code (optional U8) | 984 +-----------------------------------+ 985 | Reconnection Delay (optional U16) | 986 +-----------------------------------+ 988 Figure 13: Format of SHUTDOWN Messages 990 4 5 6 7 991 +-+-+-+-+ 992 |0|0|R|D| 993 +-+-+-+-+ 995 Figure 14: Format of SHUTDOWN Header flags 997 It is possible for a node to convey additional information regarding 998 the reason for session termination. To do so, the node MUST set the 999 'R' bit in the message header flags and transmit a one-octet reason 1000 code immediately following the message header. The specified values 1001 of the reason code are: 1003 +--------------+------+---------------------------------------------+ 1004 | Name | Code | Description | 1005 +--------------+------+---------------------------------------------+ 1006 | Idle timeout | 0x00 | The session is being closed due to | 1007 | | | idleness. | 1008 | | | | 1009 | Version | 0x01 | The node cannot conform to the specified | 1010 | mismatch | | TCPCL protocol version. | 1011 | | | | 1012 | Busy | 0x02 | The node is too busy to handle the current | 1013 | | | session. | 1014 | | | | 1015 | Contact | 0x03 | The node cannot interpret or negotiate | 1016 | Failure | | contact header option. | 1017 | | | | 1018 | TLS failure | 0x04 | The node failed to negotiate TLS session | 1019 | | | and cannot continue the session. | 1020 | | | | 1021 | Resource | 0x05 | The node has run into some resoure limit | 1022 | Exhaustion | | and cannot continue the session. | 1023 +--------------+------+---------------------------------------------+ 1025 Table 5: SHUTDOWN Reason Codes 1027 It is also possible to convey a requested reconnection delay to 1028 indicate how long the other node MUST wait before attempting session 1029 re-establishment. To do so, the node sets the 'D' bit in the message 1030 header flags and then transmits an 16-bit unsigned integer specifying 1031 the requested delay, in seconds, following the message header (and 1032 optionally, the SHUTDOWN reason code). The value 0 SHALL be 1033 interpreted as an infinite delay, i.e., that the connecting node MUST 1034 NOT re-establish the session. In contrast, if the node does not wish 1035 to request a delay, it SHOULD omit the reconnection delay field (and 1036 set the 'D' bit to zero). 1038 A session shutdown MAY occur immediately after TCP connection 1039 establishment or reception of a contact header (and prior to any 1040 further data exchange). This MAY, for example, be used to notify 1041 that the node is currently not able or willing to communicate. 1042 However, a node MUST always send the contact header to its peer 1043 before sending a SHUTDOWN message. 1045 If either node terminates a session prematurely in this manner, it 1046 SHOULD send a SHUTDOWN message and MUST indicate a reason code unless 1047 the incoming connection did not include the magic string. If the 1048 magic string was not present, a node SHOULD close the TCP connection 1049 without sending a SHUTDOWN message. If a node does not want its peer 1050 to reopen a connection immediately, it SHOULD set the 'D' bit in the 1051 flags and include a reconnection delay to indicate when the peer is 1052 allowed to attempt another session setup. 1054 If a session is to be terminated before another protocol message has 1055 completed being sent, then the node MUST NOT transmit the SHUTDOWN 1056 message but still SHOULD close the TCP connection. This means that a 1057 SHUTDOWN cannot be used to preempt any other TCPCL messaging in- 1058 progress (particularly important when large segment sizes are being 1059 transmitted). 1061 6.2. Idle Session Shutdown 1063 The protocol includes a provision for clean shutdown of idle 1064 sessions. Determining the length of time to wait before closing idle 1065 sessions, if they are to be closed at all, is an implementation and 1066 configuration matter. 1068 If there is a configured time to close idle links and if no bundle 1069 data (other than KEEPALIVE messages) has been received for at least 1070 that amount of time, then either node MAY terminate the session by 1071 transmitting a SHUTDOWN message indicating the reason code of 'Idle 1072 timeout' (as described in Table 5). After receiving a SHUTDOWN 1073 message in response, both sides MAY close the TCP connection. 1075 7. Security Considerations 1077 One security consideration for this protocol relates to the fact that 1078 nodes present their endpoint identifier as part of the contact header 1079 exchange. It would be possible for a node to fake this value and 1080 present the identity of a singleton endpoint in which the node is not 1081 a member, essentially masquerading as another DTN node. If this 1082 identifier is used outside of a TLS-secured session or without 1083 further verification as a means to determine which bundles are 1084 transmitted over the session, then the node that has falsified its 1085 identity would be able to obtain bundles that it otherwise would not 1086 have. Therefore, a node SHALL NOT use the EID value of an unsecured 1087 contact header to derive a peer node's identity unless it can 1088 corroborate it via other means. When TCPCL session security is 1089 mandatory, an endpoint SHALL transmit initial unsecured contact 1090 header values indicated in Table 6 in order. These values avoid 1091 unnecessarily leaking endpoing parameters and will be ignored when 1092 secure contact header re-exchange occurs. 1094 +--------------------+---------------------------------------------+ 1095 | Parameter | Value | 1096 +--------------------+---------------------------------------------+ 1097 | Flags | The USE_TLS flag is set. | 1098 | | | 1099 | Keepalive Interval | Zero, indicating no keepalive. | 1100 | | | 1101 | Segment MRU | Zero, indicating all segments are refused. | 1102 | | | 1103 | Transfer MRU | Zero, indicating all transfers are refused. | 1104 | | | 1105 | EID | Empty, indating lack of EID. | 1106 +--------------------+---------------------------------------------+ 1108 Table 6: Recommended Unsecured Contact Header 1110 TCPCL can be used to provide point-to-point transport security, but 1111 does not provide security of data-at-rest and does not guarantee end- 1112 to-end bundle security. The mechanisms defined in [RFC6257] and 1113 [I-D.ietf-dtn-bpsec] are to be used instead. 1115 Even when using TLS to secure the TCPCL session, the actual 1116 ciphersuite negotiated between the TLS peers MAY be insecure. TLS 1117 can be used to perform authentication without data confidentiality, 1118 for example. It is up to security policies within each TCPCL node to 1119 ensure that the negotiated TLS ciphersuite meets transport security 1120 requirements. This is identical behavior to STARTTLS use in 1121 [RFC2595]. 1123 Another consideration for this protocol relates to denial-of-service 1124 attacks. A node MAY send a large amount of data over a TCPCL 1125 session, requiring the receiving node to handle the data, attempt to 1126 stop the flood of data by sending a REFUSE_BUNDLE message, or 1127 forcibly terminate the session. This burden could cause denial of 1128 service on other, well-behaving sessions. There is also nothing to 1129 prevent a malicious node from continually establishing sessions and 1130 repeatedly trying to send copious amounts of bundle data. A 1131 listening node MAY take countermeasures such as ignoring TCP SYN 1132 messages, closing TCP connections as soon as they are established, 1133 waiting before sending the contact header, sending a SHUTDOWN message 1134 quickly or with a delay, etc. 1136 8. IANA Considerations 1138 In this section, registration procedures are as defined in [RFC5226] 1140 8.1. Port Number 1142 Port number 4556 has been previously assigned as the default port for 1143 the TCP convergence layer in [RFC7242]. This assignment is unchanged 1144 by protocol version 4. 1146 +------------------------+-------------------------------------+ 1147 | Parameter | Value | 1148 +------------------------+-------------------------------------+ 1149 | Service Name: | dtn-bundle | 1150 | | | 1151 | Transport Protocol(s): | TCP | 1152 | | | 1153 | Assignee: | Simon Perreault | 1154 | | | 1155 | Contact: | Simon Perreault | 1156 | | | 1157 | Description: | DTN Bundle TCP CL Protocol | 1158 | | | 1159 | Reference: | [RFC7242] | 1160 | | | 1161 | Port Number: | 4556 | 1162 +------------------------+-------------------------------------+ 1164 8.2. Protocol Versions 1166 IANA has created, under the "Bundle Protocol" registry, a sub- 1167 registry titled "Bundle Protocol TCP Convergence-Layer Version 1168 Numbers" and initialized it with the following table. The 1169 registration procedure is RFC Required. 1171 +-------+-------------+---------------------+ 1172 | Value | Description | Reference | 1173 +-------+-------------+---------------------+ 1174 | 0 | Reserved | [RFC7242] | 1175 | | | | 1176 | 1 | Reserved | [RFC7242] | 1177 | | | | 1178 | 2 | Reserved | [RFC7242] | 1179 | | | | 1180 | 3 | TCPCL | [RFC7242] | 1181 | | | | 1182 | 4 | TCPCLbis | This specification. | 1183 | | | | 1184 | 5-255 | Unassigned | 1185 +-------+-------------+---------------------+ 1187 8.3. Message Types 1189 IANA has created, under the "Bundle Protocol" registry, a sub- 1190 registry titled "Bundle Protocol TCP Convergence-Layer Message Types" 1191 and initialized it with the contents below. The registration 1192 procedure is RFC Required. 1194 +----------+---------------+ 1195 | Code | Message Type | 1196 +----------+---------------+ 1197 | 0x0 | Reserved | 1198 | | | 1199 | 0x1 | DATA_SEGMENT | 1200 | | | 1201 | 0x2 | ACK_SEGMENT | 1202 | | | 1203 | 0x3 | REFUSE_BUNDLE | 1204 | | | 1205 | 0x4 | KEEPALIVE | 1206 | | | 1207 | 0x5 | SHUTDOWN | 1208 | | | 1209 | 0x6 | LENGTH | 1210 | | | 1211 | TBD | REJECT | 1212 | | | 1213 | TBD--0xf | Unassigned | 1214 +----------+---------------+ 1216 Message Type Codes 1218 8.4. REFUSE_BUNDLE Reason Codes 1220 IANA has created, under the "Bundle Protocol" registry, a sub- 1221 registry titled "Bundle Protocol TCP Convergence-Layer REFUSE_BUNDLE 1222 Reason Codes" and initialized it with the contents of Table 3. The 1223 registration procedure is RFC Required. 1225 +----------+---------------------------+ 1226 | Code | Refusal Reason | 1227 +----------+---------------------------+ 1228 | 0x0 | Unknown | 1229 | | | 1230 | 0x1 | Completed | 1231 | | | 1232 | 0x2 | No Resources | 1233 | | | 1234 | 0x3 | Retransmit | 1235 | | | 1236 | 0x4--0x7 | Unassigned | 1237 | | | 1238 | 0x8--0xf | Reserved for future usage | 1239 +----------+---------------------------+ 1241 REFUSE_BUNDLE Reason Codes 1243 8.5. SHUTDOWN Reason Codes 1245 IANA has created, under the "Bundle Protocol" registry, a sub- 1246 registry titled "Bundle Protocol TCP Convergence-Layer SHUTDOWN 1247 Reason Codes" and initialized it with the contents of Table 4. The 1248 registration procedure is RFC Required. 1250 +-----------+------------------+ 1251 | Code | Shutdown Reason | 1252 +-----------+------------------+ 1253 | 0x00 | Idle timeout | 1254 | | | 1255 | 0x01 | Version mismatch | 1256 | | | 1257 | 0x02 | Busy | 1258 | | | 1259 | TBD | Contact Failure | 1260 | | | 1261 | TBD | TLS failure | 1262 | | | 1263 | TBD--0xFF | Unassigned | 1264 +-----------+------------------+ 1266 SHUTDOWN Reason Codes 1268 8.6. REJECT Reason Codes 1270 EDITOR NOTE: sub-registry to-be-created upon publication of this 1271 specification. 1273 IANA will create, under the "Bundle Protocol" registry, a sub- 1274 registry titled "Bundle Protocol TCP Convergence-Layer REJECT Reason 1275 Codes" and initialized it with the contents of Table 4. The 1276 registration procedure is RFC Required. 1278 +-----------+----------------------+ 1279 | Code | Rejection Reason | 1280 +-----------+----------------------+ 1281 | 0x00 | reserved | 1282 | | | 1283 | 0x01 | Message Type Unknown | 1284 | | | 1285 | 0x02 | Message Unsupported | 1286 | | | 1287 | 0x03 | Message Unexpected | 1288 | | | 1289 | 0x04-0xFF | Unassigned | 1290 +-----------+----------------------+ 1292 REJECT Reason Codes 1294 9. Acknowledgments 1296 This memo is based on comments on implementation of [RFC7242] 1297 provided from Scott Burleigh. 1299 10. References 1301 10.1. Normative References 1303 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1304 Requirement Levels", BCP 14, RFC 2119, 1305 DOI 10.17487/RFC2119, March 1997, 1306 . 1308 [RFC5050] Scott, K. and S. Burleigh, "Bundle Protocol 1309 Specification", RFC 5050, DOI 10.17487/RFC5050, November 1310 2007, . 1312 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1313 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1314 DOI 10.17487/RFC5226, May 2008, 1315 . 1317 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1318 (TLS) Protocol Version 1.2", RFC 5246, 1319 DOI 10.17487/RFC5246, August 2008, 1320 . 1322 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 1323 "Recommendations for Secure Use of Transport Layer 1324 Security (TLS) and Datagram Transport Layer Security 1325 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 1326 2015, . 1328 [I-D.ietf-dtn-bpbis] 1329 Burleigh, S., Fall, K., and E. Birrane, "Bundle Protocol", 1330 draft-ietf-dtn-bpbis-06 (work in progress), October 2016. 1332 [refs.IANA-BP] 1333 IANA, "Bundle Protocol registry", May 2016. 1335 10.2. Informative References 1337 [RFC2595] Newman, C., "Using TLS with IMAP, POP3 and ACAP", 1338 RFC 2595, DOI 10.17487/RFC2595, June 1999, 1339 . 1341 [RFC4838] Cerf, V., Burleigh, S., Hooke, A., Torgerson, L., Durst, 1342 R., Scott, K., Fall, K., and H. Weiss, "Delay-Tolerant 1343 Networking Architecture", RFC 4838, DOI 10.17487/RFC4838, 1344 April 2007, . 1346 [RFC6257] Symington, S., Farrell, S., Weiss, H., and P. Lovell, 1347 "Bundle Security Protocol Specification", RFC 6257, 1348 DOI 10.17487/RFC6257, May 2011, 1349 . 1351 [RFC7242] Demmer, M., Ott, J., and S. Perreault, "Delay-Tolerant 1352 Networking TCP Convergence-Layer Protocol", RFC 7242, 1353 DOI 10.17487/RFC7242, June 2014, 1354 . 1356 [I-D.ietf-dtn-bpsec] 1357 Birrane, E. and K. McKeever, "Bundle Protocol Security 1358 Specification", draft-ietf-dtn-bpsec-03 (work in 1359 progress), October 2016. 1361 Appendix A. Significant changes from RFC7242 1363 The areas in which changes from [RFC7242] have been made to existing 1364 messages are: 1366 o Changed contact header content to limit number of negotiated 1367 options. 1369 o Added contact option to negotiate maximum segment size (per each 1370 direction). 1372 o Added a bundle transfer identification number to all bundle- 1373 related messages (LENGTH, DATA_SEGMENT, ACK_SEGMENT, 1374 REFUSE_BUNDLE). 1376 o Use flags in ACK_SEGMENT to mirror flags from DATA_SEGMENT. 1378 o Removed all uses of SDNV fields and replaced with fixed-bit-length 1379 fields. 1381 The areas in which extensions from [RFC7242] have been made as new 1382 messages and codes are: 1384 o Added contact negotation failure SHUTDOWN reason code. 1386 o Added REJECT message to indicate an unknown or unhandled message 1387 was received. 1389 o Added TLS session security mechanism. 1391 o Added TLS failure SHUTDOWN reason code. 1393 Authors' Addresses 1395 Brian Sipos 1396 RKF Engineering Solutions, LLC 1397 1229 19th Street NW 1398 Wasington, DC 20036 1399 US 1401 Email: BSipos@rkf-eng.com 1403 Michael Demmer 1404 University of California, Berkeley 1405 Computer Science Division 1406 445 Soda Hall 1407 Berkeley, CA 94720-1776 1408 US 1410 Email: demmer@cs.berkeley.edu 1411 Joerg Ott 1412 Aalto University 1413 Department of Communications and Networking 1414 PO Box 13000 1415 Aalto 02015 1416 Finland 1418 Email: jo@netlab.tkk.fi 1420 Simon Perreault 1421 Quebec, QC 1422 Canada 1424 Email: simon@per.reau.lt