idnits 2.17.1 draft-ietf-dtn-tcpclv4-08.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 draft header indicates that this document obsoletes RFC7242, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (May 20, 2018) is 2167 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 532, but not defined == Missing Reference: 'L1' is mentioned on line 520, but not defined == Missing Reference: 'L2' is mentioned on line 520, but not defined == Missing Reference: 'L3' is mentioned on line 526, but not defined == Outdated reference: A later version (-31) exists of draft-ietf-dtn-bpbis-10 ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** 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 (-27) exists of draft-ietf-dtn-bpsec-06 Summary: 5 errors (**), 0 flaws (~~), 7 warnings (==), 2 comments (--). 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: 7242 (if approved) M. Demmer 5 Intended status: Standards Track UC Berkeley 6 Expires: November 21, 2018 J. Ott 7 Aalto University 8 S. Perreault 9 May 20, 2018 11 Delay-Tolerant Networking TCP Convergence Layer Protocol Version 4 12 draft-ietf-dtn-tcpclv4-08 14 Abstract 16 This document describes a revised protocol for the TCP-based 17 convergence layer (TCPCL) for Delay-Tolerant Networking (DTN). The 18 protocol revision is based on implementation issues in the original 19 TCPCL Version 3 and updates to the Bundle Protocol contents, 20 encodings, and convergence layer requirements in Bundle Protocol 21 Version 7. Specifically, the TCPCLv4 uses CBOR-encoded BPv7 bundles 22 as its service data unit being transported and provides a reliable 23 transport of such bundles. Several new IANA registries are defined 24 for TCPCLv4 which define some behaviors inherited from TCPCLv3 but 25 with updated encodings and/or semantics. 27 Status of This Memo 29 This Internet-Draft is submitted in full conformance with the 30 provisions of BCP 78 and BCP 79. 32 Internet-Drafts are working documents of the Internet Engineering 33 Task Force (IETF). Note that other groups may also distribute 34 working documents as Internet-Drafts. The list of current Internet- 35 Drafts is at https://datatracker.ietf.org/drafts/current/. 37 Internet-Drafts are draft documents valid for a maximum of six months 38 and may be updated, replaced, or obsoleted by other documents at any 39 time. It is inappropriate to use Internet-Drafts as reference 40 material or to cite them other than as "work in progress." 42 This Internet-Draft will expire on November 21, 2018. 44 Copyright Notice 46 Copyright (c) 2018 IETF Trust and the persons identified as the 47 document authors. All rights reserved. 49 This document is subject to BCP 78 and the IETF Trust's Legal 50 Provisions Relating to IETF Documents 51 (https://trustee.ietf.org/license-info) in effect on the date of 52 publication of this document. Please review these documents 53 carefully, as they describe your rights and restrictions with respect 54 to this document. Code Components extracted from this document must 55 include Simplified BSD License text as described in Section 4.e of 56 the Trust Legal Provisions and are provided without warranty as 57 described in the Simplified BSD License. 59 Table of Contents 61 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 62 1.1. Convergence Layer Services . . . . . . . . . . . . . . . 4 63 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 6 64 2.1. Definitions Specific to the TCPCL Protocol . . . . . . . 6 65 3. General Protocol Description . . . . . . . . . . . . . . . . 8 66 3.1. TCPCL Session Overview . . . . . . . . . . . . . . . . . 8 67 3.2. Transfer Segmentation Policies . . . . . . . . . . . . . 10 68 3.3. Example Message Exchange . . . . . . . . . . . . . . . . 11 69 4. Session Establishment . . . . . . . . . . . . . . . . . . . . 13 70 4.1. TCP Connection . . . . . . . . . . . . . . . . . . . . . 13 71 4.2. Contact Header . . . . . . . . . . . . . . . . . . . . . 13 72 4.3. Contact Validation and Negotiation . . . . . . . . . . . 14 73 4.4. Session Security . . . . . . . . . . . . . . . . . . . . 15 74 4.4.1. TLS Handshake Result . . . . . . . . . . . . . . . . 16 75 4.4.2. Example TLS Initiation . . . . . . . . . . . . . . . 16 76 4.5. Message Type Codes . . . . . . . . . . . . . . . . . . . 17 77 4.6. Session Initialization Message (SESS_INIT) . . . . . . . 18 78 4.6.1. Session Extension Items . . . . . . . . . . . . . . . 20 79 4.7. Session Parameter Negotiation . . . . . . . . . . . . . . 21 80 5. Established Session Operation . . . . . . . . . . . . . . . . 22 81 5.1. Upkeep and Status Messages . . . . . . . . . . . . . . . 22 82 5.1.1. Session Upkeep (KEEPALIVE) . . . . . . . . . . . . . 22 83 5.1.2. Message Rejection (MSG_REJECT) . . . . . . . . . . . 23 84 5.2. Bundle Transfer . . . . . . . . . . . . . . . . . . . . . 24 85 5.2.1. Bundle Transfer ID . . . . . . . . . . . . . . . . . 24 86 5.2.2. Transfer Initialization (XFER_INIT) . . . . . . . . . 25 87 5.2.3. Data Transmission (XFER_SEGMENT) . . . . . . . . . . 28 88 5.2.4. Data Acknowledgments (XFER_ACK) . . . . . . . . . . . 29 89 5.2.5. Transfer Refusal (XFER_REFUSE) . . . . . . . . . . . 30 90 6. Session Termination . . . . . . . . . . . . . . . . . . . . . 32 91 6.1. Session Termination Message (SESS_TERM) . . . . . . . . . 32 92 6.2. Idle Session Shutdown . . . . . . . . . . . . . . . . . . 35 93 7. Implementation Status . . . . . . . . . . . . . . . . . . . . 35 94 8. Security Considerations . . . . . . . . . . . . . . . . . . . 35 95 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 37 96 9.1. Port Number . . . . . . . . . . . . . . . . . . . . . . . 37 97 9.2. Protocol Versions . . . . . . . . . . . . . . . . . . . . 37 98 9.3. Session Extension Types . . . . . . . . . . . . . . . . . 38 99 9.4. Transfer Extension Types . . . . . . . . . . . . . . . . 38 100 9.5. Message Types . . . . . . . . . . . . . . . . . . . . . . 39 101 9.6. XFER_REFUSE Reason Codes . . . . . . . . . . . . . . . . 40 102 9.7. SESS_TERM Reason Codes . . . . . . . . . . . . . . . . . 41 103 9.8. MSG_REJECT Reason Codes . . . . . . . . . . . . . . . . . 42 104 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 42 105 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 106 11.1. Normative References . . . . . . . . . . . . . . . . . . 42 107 11.2. Informative References . . . . . . . . . . . . . . . . . 43 108 Appendix A. Significant changes from RFC7242 . . . . . . . . . . 44 109 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 45 111 1. Introduction 113 This document describes the TCP-based convergence-layer protocol for 114 Delay-Tolerant Networking. Delay-Tolerant Networking is an end-to- 115 end architecture providing communications in and/or through highly 116 stressed environments, including those with intermittent 117 connectivity, long and/or variable delays, and high bit error rates. 118 More detailed descriptions of the rationale and capabilities of these 119 networks can be found in "Delay-Tolerant Network Architecture" 120 [RFC4838]. 122 An important goal of the DTN architecture is to accommodate a wide 123 range of networking technologies and environments. The protocol used 124 for DTN communications is the Bundle Protocol Version 7 (BPv7) 125 [I-D.ietf-dtn-bpbis], an application-layer protocol that is used to 126 construct a store-and-forward overlay network. BPv7 requires the 127 services of a "convergence-layer adapter" (CLA) to send and receive 128 bundles using the service of some "native" link, network, or Internet 129 protocol. This document describes one such convergence-layer adapter 130 that uses the well-known Transmission Control Protocol (TCP). This 131 convergence layer is referred to as TCP Convergence Layer Version 4 132 (TCPCLv4). For the remainder of this document, the abbreviation "BP" 133 without the version suffix refers to BPv7. For the remainder of this 134 document, the abbreviation "TCPCL" without the version suffix refers 135 to TCPCLv4. 137 The locations of the TCPCL and the BP in the Internet model protocol 138 stack (described in [RFC1122]) are shown in Figure 1. In particular, 139 when BP is using TCP as its bearer with TCPCL as its convergence 140 layer, both BP and TCPCL reside at the application layer of the 141 Internet model. 143 +-------------------------+ 144 | DTN Application | -\ 145 +-------------------------| | 146 | Bundle Protocol (BP) | -> Application Layer 147 +-------------------------+ | 148 | TCP Conv. Layer (TCPCL) | | 149 +-------------------------+ | 150 | TLS (optional) | -/ 151 +-------------------------+ 152 | TCP | ---> Transport Layer 153 +-------------------------+ 154 | IPv4/IPv6 | ---> Network Layer 155 +-------------------------+ 156 | Link-Layer Protocol | ---> Link Layer 157 +-------------------------+ 159 Figure 1: The Locations of the Bundle Protocol and the TCP 160 Convergence-Layer Protocol above the Internet Protocol Stack 162 This document describes the format of the protocol data units passed 163 between entities participating in TCPCL communications. This 164 document does not address: 166 o The format of protocol data units of the Bundle Protocol, as those 167 are defined elsewhere in [RFC5050] and [I-D.ietf-dtn-bpbis]. This 168 includes the concept of bundle fragmentation or bundle 169 encapsulation. The TCPCL transfers bundles as opaque data blocks. 171 o Mechanisms for locating or identifying other bundle entities 172 within an internet. 174 1.1. Convergence Layer Services 176 This version of the TCPCL provides the following services to support 177 the overlaying Bundle Protocol agent: 179 Attempt Session The TCPCL allows a BP agent to pre-emptively attempt 180 to establish a TCPCL session with a peer entity. Each session 181 attempt can send a different set of contact header parameters as 182 directed by the BP agent. 184 Shutdown Session The TCPCL allows a BP agent to pre-emptively 185 shutdown an established TCPCL session with a peer entity. The 186 shutdown request is on a per-session basis. 188 Session is Started The TCPCL supports indication when a new TCP 189 connection has been started (as either client or server) before 190 the TCPCL handshake has begun. 192 Session is Established The TCPCL supports indication when a new 193 session has been fully established and is ready for its first 194 transfer. 196 Session is Shutdown The TCPCL supports indication when an 197 established session has been ended by normal exchange of SESS_TERM 198 messages with all transfers completed. 200 Session is Failed The TCPCL supports indication when a session 201 fails, either during contact negotiation, TLS negotiation, or 202 after establishement for any reason other than normal shutdown. 204 Begin Transmission The principal purpose of the TCPCL is to allow a 205 BP agent to transmit bundle data over an established TCPCL 206 session. Transmission request is on a per-session basis, the CL 207 does not necessarily perform any per-session or inter-session 208 queueing. Any queueing of transmissions is the obligation of the 209 BP agent. 211 Transmission Availability Because TCPCL transmits serially over a 212 TCP connection, it suffers from "head of queue blocking" and 213 supports indication of when an established session is live-but- 214 idle (i.e. available for immediate transfer start) or live-and- 215 not-idle. 217 Transmission Success The TCPCL supports positive indication when a 218 bundle has been fully transferred to a peer entity. 220 Transmission Intermediate Progress The TCPCL supports positive 221 indication of intermediate progress of transferr to a peer entity. 222 This intermediate progress is at the granularity of each 223 transferred segment. 225 Transmission Failure The TCPCL supports positive indication of 226 certain reasons for bundle transmission failure, notably when the 227 peer entity rejects the bundle or when a TCPCL session ends before 228 transferr success. The TCPCL itself does not have a notion of 229 transfer timeout. 231 Interrupt Reception The TCPCL allows a BP agent to interrupt an 232 individual transfer before it has fully completed (successfully or 233 not). 235 Reception Success The TCPCL supports positive indication when a 236 bundle has been fully transferred from a peer entity. 238 Reception Intermediate Progress The TCPCL supports positive 239 indication of intermediate progress of transfer from the peer 240 entity. This intermediate progress is at the granularity of each 241 transferred segment. Intermediate reception indication allows a 242 BP agent the chance to inspect bundle header contents before the 243 entire bundle is available, and thus supports the "Reception 244 Interruption" capability. 246 Reception Failure The TCPCL supports positive indication of certain 247 reasons for reception failure, notably when the local entity 248 rejects an attempted transfer for some local policy reason or when 249 a TCPCL session ends before transfer success. The TCPCL itself 250 does not have a notion of transfer timeout. 252 2. Requirements Language 254 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 255 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 256 document are to be interpreted as described in [RFC2119]. 258 2.1. Definitions Specific to the TCPCL Protocol 260 This section contains definitions specific to the TCPCL protocol. 262 TCPCL Entity: This is the notional TCPCL application that initiates 263 TCPCL sessions. This design, implementation, configuration, and 264 specific behavior of such an entity is outside of the scope of 265 this document. However, the concept of an entity has utility 266 within the scope of this document as the container and initiator 267 of TCPCL sessions. The relationship between a TCPCL entity and 268 TCPCL sessions is defined as follows: 270 A TCPCL Entity MAY actively initiate any number of TCPCL 271 Sessions and should do so whenever the entity is the initial 272 transmitter of information to another entity in the network. 274 A TCPCL Entity MAY support zero or more passive listening 275 elements that listen for connection requests from other TCPCL 276 Entities operating on other entitys in the network. 278 A TCPCL Entity MAY passivley initiate any number of TCPCL 279 Sessions from requests received by its passive listening 280 element(s) if the entity uses such elements. 282 For most TCPCL behavior within a session, the two entities are 283 symmetric and there is no protocol distinction between them. Some 284 specific behavior, particularly during session establishment, 285 distinguishes between the active entity and the passive entity. 286 For the remainder of this document, the term "entity" without the 287 prefix "TCPCL" refers to a TCPCL entity. 289 TCP Connection: The term Connection in this specification 290 exclusively refers to a TCP connection and any and all behaviors, 291 sessions, and other states association with that TCP connection. 293 TCPCL Session: A TCPCL session (as opposed to a TCP connection) is a 294 TCPCL communication relationship between two TCPCL entities. 295 Within a single TCPCL session there are two possible transfer 296 streams; one in each direction, with one stream from each entity 297 being the outbound stream and the other being the inbound stream. 298 The lifetime of a TCPCL session is bound to the lifetime of an 299 underlying TCP connection. A TCPCL session is terminated when the 300 TCP connection ends, due either to one or both entities actively 301 terminating the TCP connection or due to network errors causing a 302 failure of the TCP connection. For the remainder of this 303 document, the term "session" without the prefix "TCPCL" refers to 304 a TCPCL session. 306 Session parameters: These are a set of values used to affect the 307 operation of the TCPCL for a given session. The manner in which 308 these parameters are conveyed to the bundle entity and thereby to 309 the TCPCL is implementation dependent. However, the mechanism by 310 which two entities exchange and negotiate the values to be used 311 for a given session is described in Section 4.3. 313 Transfer Stream: A Transfer stream is a uni-directional user-data 314 path within a TCPCL Session. Messages sent over a transfer stream 315 are serialized, meaning that one set of user data must complete 316 its transmission prior to another set of user data being 317 transmitted over the same transfer stream. Each uni-directional 318 stream has a single sender entity and a single receiver entity. 320 Transfer: This refers to the procedures and mechanisms for 321 conveyance of an individual bundle from one node to another. Each 322 transfer within TCPCL is identified by a Transfer ID number which 323 is unique only to a single direction within a single Session. 325 Transfer Segment: A subset of a transfer of user data being 326 communicated over a trasnfer stream. 328 Idle Session: A TCPCL session is idle while the only messages being 329 transmitted or received are KEEPALIVE messages. 331 Live Session: A TCPCL session is live while any messages are being 332 transmitted or received. 334 Reason Codes: The TCPCL uses numeric codes to encode specific 335 reasons for individual failure/error message types. 337 The relationship between connections, sessions, and streams is shown 338 in Figure 2. 340 +----------------------------+ +--------------------------+ 341 | TCPCL Session | | TCPCL "Other" Session | 342 | | | | 343 | +-----------------------+ | | +---------------------+ | 344 | | TCP Connection | | | | TCP Connection | | 345 | | | | | | | | 346 | | +-------------------+ | | | | +-----------------+ | | 347 | | | Optional Inbound | | | | | | Peer Outbound | | | 348 | | | Transfer Stream |<-[Seg]--[Seg]--[Seg]-| | Transfer Stream | | | 349 | | | ----- | | | | | | ----- | | | 350 | | | RECEIVER | | | | | | SENDER | | | 351 | | +-------------------+ | | | | +-----------------+ | | 352 | | | | | | | | 353 | | +-------------------+ | | | | +-----------------+ | | 354 | | | Optional Outbound | | | | | | Peer Inbound | | | 355 | | | Transfer Stream |------[Seg]---[Seg]---->| Transfer Stream | | | 356 | | | ----- | | | | | | ----- | | | 357 | | | SENDER | | | | | | RECEIVER | | | 358 | | +-------------------+ | | | | +-----------------+ | | 359 | +-----------------------+ | | +---------------------+ | 360 +----------------------------+ +--------------------------+ 362 Figure 2: The relationship within a TCPCL Session of its two streams 364 3. General Protocol Description 366 The service of this protocol is the transmission of DTN bundles via 367 the Transmission Control Protocol (TCP). This document specifies the 368 encapsulation of bundles, procedures for TCP setup and teardown, and 369 a set of messages and node requirements. The general operation of 370 the protocol is as follows. 372 3.1. TCPCL Session Overview 374 First, one node establishes a TCPCL session to the other by 375 initiating a TCP connection in accordance with [RFC0793]. After 376 setup of the TCP connection is complete, an initial contact header is 377 exchanged in both directions to set parameters of the TCPCL session 378 and exchange a singleton endpoint identifier for each node (not the 379 singleton Endpoint Identifier (EID) of any application running on the 380 node) to denote the bundle-layer identity of each DTN node. This is 381 used to assist in routing and forwarding messages (e.g. to prevent 382 loops). 384 Once the TCPCL session is established and configured in this way, 385 bundles can be transferred in either direction. Each transfer is 386 performed by an initialization (XFER_INIT) message followed by one or 387 more logical segments of data within an XFER_SEGMENT message. 388 Multiple bundles can be transmitted consecutively on a single TCPCL 389 connection. Segments from different bundles are never interleaved. 390 Bundle interleaving can be accomplished by fragmentation at the BP 391 layer or by establishing multiple TCPCL sessions between the same 392 peers. 394 A feature of this protocol is for the receiving node to send 395 acknowledgment (XFER_ACK) messages as bundle data segments arrive . 396 The rationale behind these acknowledgments is to enable the sender 397 node to determine how much of the bundle has been received, so that 398 in case the session is interrupted, it can perform reactive 399 fragmentation to avoid re-sending the already transmitted part of the 400 bundle. In addition, there is no explicit flow control on the TCPCL 401 layer. 403 A TCPCL receiver can interrupt the transmission of a bundle at any 404 point in time by replying with a XFER_REFUSE message, which causes 405 the sender to stop transmission of the associated bundle (if it 406 hasn't already finished transmission) Note: This enables a cross- 407 layer optimization in that it allows a receiver that detects that it 408 already has received a certain bundle to interrupt transmission as 409 early as possible and thus save transmission capacity for other 410 bundles. 412 For sessions that are idle, a KEEPALIVE message is sent at a 413 negotiated interval. This is used to convey node live-ness 414 information during otherwise message-less time intervals. 416 A SESS_TERM message is used to start the closing of a TCPCL session 417 (see Section 6.1). During shutdown sequencing, in-progress transfers 418 can be completed but no new transfers can be initiated. A SESS_TERM 419 message can also be used to refuse a session setup by a peer (see 420 Section 4.3). It is an implementation matter to determine whether or 421 not to close a TCPCL session while there are no transfers queued or 422 in-progress. 424 TCPCL is a symmetric protocol between the peers of a session. Both 425 sides can start sending data segments in a session, and one side's 426 bundle transfer does not have to complete before the other side can 427 start sending data segments on its own. Hence, the protocol allows 428 for a bi-directional mode of communication. Note that in the case of 429 concurrent bidirectional transmission, acknowledgment segments MAY be 430 interleaved with data segments. 432 3.2. Transfer Segmentation Policies 434 Each TCPCL session allows a negotiated transfer segmentation polcy to 435 be applied in each transfer direction. A receiving node can set the 436 Segment MRU in its contact header to determine the largest acceptable 437 segment size, and a transmitting node can segment a transfer into any 438 sizes smaller than the receiver's Segment MRU. It is a network 439 administration matter to determine an appropriate segmentation policy 440 for entities operating TCPCL, but guidance given here can be used to 441 steer policy toward performance goals. 443 Minimum Overhead For a simple network expected to exchange 444 relatively small bundles, the Segment MRU can be set to be 445 identical to the Transfer MRU which indicates that all transfers 446 can be sent with a single data segment (i.e. no actual 447 segmentation). If the network is closed and all transmitters are 448 known to follow a single-segment transfer policy, then receivers 449 can avoid the necessity of segment reassembly. Because this CL 450 operates over a TCP stream, which suffers from a form of head-of- 451 queue blocking between messages, while one node is transmitting a 452 single XFER_SEGMENT message it is not able to transmit any 453 XFER_ACK or XFER_REFUSE for any associated received transfers. 455 Predictable Message Sizing In situations where the maximum message 456 size is desired to be well-controlled, the Segment MRU can be set 457 to the largest acceptable size (the message size less XFER_SEGMENT 458 header size) and transmitters can always segment a transfer into 459 maximum-size chunks no larger than the Segment MRU. This 460 guarantees that any single XFER_SEGMENT will not monopolize the 461 TCP stream for too long, which would prevent outgoing XFER_ACK and 462 XFER_REFUSE associated with received transfers. 464 Dynamic Segmentation Even after negotiation of a Segment MRU for 465 each receiving node, the actual transfer segmentation only needs 466 to guarantee than any individual segment is no larger than that 467 MRU. In a situation where network "goodput" is dynamic, the 468 transfer segmentation size can also be dynamic in order to control 469 message transmission duration. 471 Many other policies can be established in a TCPCL network between 472 these two extremes. Different policies can be applied to each 473 direction to/from any particular node. Additionally, future header 474 and transfer extension types can apply further nuance to transfer 475 policies and policy negotiation. 477 3.3. Example Message Exchange 479 The following figure depicts the protocol exchange for a simple 480 session, showing the session establishment and the transmission of a 481 single bundle split into three data segments (of lengths "L1", "L2", 482 and "L3") from Entity A to Entity B. 484 Note that the sending node MAY transmit multiple XFER_SEGMENT 485 messages without necessarily waiting for the corresponding XFER_ACK 486 responses. This enables pipelining of messages on a channel. 487 Although this example only demonstrates a single bundle transmission, 488 it is also possible to pipeline multiple XFER_SEGMENT messages for 489 different bundles without necessarily waiting for XFER_ACK messages 490 to be returned for each one. However, interleaving data segments 491 from different bundles is not allowed. 493 No errors or rejections are shown in this example. 495 Entity A Entity B 496 ======== ======== 497 +-------------------------+ 498 | Contact Header | -> +-------------------------+ 499 +-------------------------+ <- | Contact Header | 500 +-------------------------+ 501 +-------------------------+ 502 | SESS_INIT | -> +-------------------------+ 503 +-------------------------+ <- | SESS_INIT | 504 +-------------------------+ 506 +-------------------------+ 507 | XFER_INIT | -> 508 | Transfer ID [I1] | 509 | Total Length [L1] | 510 +-------------------------+ 511 +-------------------------+ 512 | XFER_SEGMENT (start) | -> 513 | Transfer ID [I1] | 514 | Length [L1] | 515 | Bundle Data 0..(L1-1) | 516 +-------------------------+ 517 +-------------------------+ +-------------------------+ 518 | XFER_SEGMENT | -> <- | XFER_ACK (start) | 519 | Transfer ID [I1] | | Transfer ID [I1] | 520 | Length [L2] | | Length [L1] | 521 |Bundle Data L1..(L1+L2-1)| +-------------------------+ 522 +-------------------------+ 523 +-------------------------+ +-------------------------+ 524 | XFER_SEGMENT (end) | -> <- | XFER_ACK | 525 | Transfer ID [I1] | | Transfer ID [I1] | 526 | Length [L3] | | Length [L1+L2] | 527 |Bundle Data | +-------------------------+ 528 | (L1+L2)..(L1+L2+L3-1)| 529 +-------------------------+ 530 +-------------------------+ 531 <- | XFER_ACK (end) | 532 | Transfer ID [I1] | 533 | Length [L1+L2+L3] | 534 +-------------------------+ 536 +-------------------------+ 537 | SESS_TERM | -> +-------------------------+ 538 +-------------------------+ <- | SESS_TERM | 539 +-------------------------+ 541 Figure 3: An example of the flow of protocol messages on a single TCP 542 Session between two entities 544 4. Session Establishment 546 For bundle transmissions to occur using the TCPCL, a TCPCL session 547 MUST first be established between communicating entities. It is up 548 to the implementation to decide how and when session setup is 549 triggered. For example, some sessions MAY be opened proactively and 550 maintained for as long as is possible given the network conditions, 551 while other sessions MAY be opened only when there is a bundle that 552 is queued for transmission and the routing algorithm selects a 553 certain next-hop node. 555 4.1. TCP Connection 557 To establish a TCPCL session, an entity MUST first establish a TCP 558 connection with the intended peer entity, typically by using the 559 services provided by the operating system. Destination port number 560 4556 has been assigned by IANA as the Registered Port number for the 561 TCP convergence layer. Other destination port numbers MAY be used 562 per local configuration. Determining a peer's destination port 563 number (if different from the registered TCPCL port number) is up to 564 the implementation. Any source port number MAY be used for TCPCL 565 sessions. Typically an operating system assigned number in the TCP 566 Ephemeral range (49152-65535) is used. 568 If the entity is unable to establish a TCP connection for any reason, 569 then it is an implementation matter to determine how to handle the 570 connection failure. An entity MAY decide to re-attempt to establish 571 the connection. If it does so, it MUST NOT overwhelm its target with 572 repeated connection attempts. Therefore, the entity MUST retry the 573 connection setup no earlier than some delay time from the last 574 attempt, and it SHOULD use a (binary) exponential backoff mechanism 575 to increase this delay in case of repeated failures. 577 Once a TCP connection is established, each entity MUST immediately 578 transmit a contact header over the TCP connection. The format of the 579 contact header is described in Section 4.2. 581 4.2. Contact Header 583 Once a TCP connection is established, both parties exchange a contact 584 header. This section describes the format of the contact header and 585 the meaning of its fields. 587 Upon receipt of the contact header, both entities perform the 588 validation and negotiation procedures defined in Section 4.3. After 589 receiving the contact header from the other entity, either entity MAY 590 refuse the session by sending a SESS_TERM message with an appropriate 591 reason code. 593 The format for the Contact Header is as follows: 595 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 596 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 597 +---------------+---------------+---------------+---------------+ 598 | magic='dtn!' | 599 +---------------+---------------+---------------+---------------+ 600 | Version | Flags | 601 +---------------+---------------+ 603 Figure 4: Contact Header Format 605 See Section 4.3 for details on the use of each of these contact 606 header fields. The fields of the contact header are: 608 magic: A four-octet field that always contains the octet sequence 609 0x64 0x74 0x6e 0x21, i.e., the text string "dtn!" in US-ASCII (and 610 UTF-8). 612 Version: A one-octet field value containing the value 4 (current 613 version of the protocol). 615 Flags: A one-octet field of single-bit flags, interpreted according 616 to the descriptions in Table 1. 618 +----------+--------+-----------------------------------------------+ 619 | Name | Code | Description | 620 +----------+--------+-----------------------------------------------+ 621 | CAN_TLS | 0x01 | If bit is set, indicates that the sending | 622 | | | peer is capable of TLS security. | 623 | | | | 624 | Reserved | others | 625 +----------+--------+-----------------------------------------------+ 627 Table 1: Contact Header Flags 629 4.3. Contact Validation and Negotiation 631 Upon reception of the contact header, each node follows the following 632 procedures to ensure the validity of the TCPCL session and to 633 negotiate values for the session parameters. 635 If the magic string is not present or is not valid, the connection 636 MUST be terminated. The intent of the magic string is to provide 637 some protection against an inadvertent TCP connection by a different 638 protocol than the one described in this document. To prevent a flood 639 of repeated connections from a misconfigured application, an entity 640 MAY elect to hold an invalid connection open and idle for some time 641 before closing it. 643 A connecting TCPCL node SHALL send the highest TCPCL protocol version 644 on a first session attempt for a TCPCL peer. If a connecting node 645 receives a SESS_TERM message with reason of "Version Mismatch", that 646 node MAY attempt further TCPCL sessions with the peer using earlier 647 protocol version numbers in decreasing order. Managing multi-TCPCL- 648 session state such as this is an implementation matter. 650 If an entity receives a contact header containing a version that is 651 greater than the current version of the protocol that the node 652 implements, then the node SHALL shutdown the session with a reason 653 code of "Version mismatch". If an entity receives a contact header 654 with a version that is lower than the version of the protocol that 655 the node implements, the node MAY either terminate the session (with 656 a reason code of "Version mismatch") or the node MAY adapt its 657 operation to conform to the older version of the protocol. The 658 decision of version fall-back is an implementation matter. 660 4.4. Session Security 662 This version of the TCPCL supports establishing a Transport Layer 663 Security (TLS) session within an existing TCP connection. When TLS 664 is used within the TCPCL it affects the entire session. Once 665 established, there is no mechanism available to downgrade a TCPCL 666 session to non-TLS operation. If this is desired, the entire TCPCL 667 session MUST be shutdown and a new non-TLS-negotiated session 668 established. 670 The use of TLS is negotated using the Contact Header as described in 671 Section 4.3. After negotiating an Enable TLS parameter of true, and 672 before any other TCPCL messages are sent within the session, the 673 session entities SHALL begin a TLS handshake in accordance with 674 [RFC5246]. The parameters within each TLS negotiation are 675 implementation dependent but any TCPCL node SHOULD follow all 676 recommended best practices of [RFC7525]. By convention, this 677 protocol uses the node which initiated the underlying TCP connection 678 as the "client" role of the TLS handshake request. 680 The TLS handshake, if it occurs, is considered to be part of the 681 contact negotiation before the TCPCL session itself is established. 682 Specifics about sensitive data exposure are discussed in Section 8. 684 4.4.1. TLS Handshake Result 686 If a TLS handshake cannot negotiate a TLS session, both entities of 687 the TCPCL session SHALL start a TCPCL shutdown with reason "TLS 688 Failure". 690 After a TLS session is successfully established, both TCPCL entities 691 SHALL re-exchange TCPCL Contact Header messages. Any information 692 cached from the prior Contact Header exchange SHALL be discarded. 693 This re-exchange avoids a "man-in-the-middle" attack in identical 694 fashion to [RFC2595]. Each re-exchange header CAN_TLS flag SHALL be 695 identical to the original header CAN_TLS flag from the same node. 696 The CAN_TLS logic (TLS negotiation) SHALL NOT apply during header re- 697 exchange. This reinforces the fact that there is no TLS downgrade 698 mechanism. 700 4.4.2. Example TLS Initiation 702 A summary of a typical CAN_TLS usage is shown in the sequence in 703 Figure 5 below. 705 Entity A Entity B 706 ======== ======== 708 +-------------------------+ 709 | Open TCP Connnection | -> 710 +-------------------------+ +-------------------------+ 711 <- | Accept Connection | 712 +-------------------------+ 714 +-------------------------+ +-------------------------+ 715 | Contact Header | -> <- | Contact Header | 716 +-------------------------+ +-------------------------+ 718 +-------------------------+ +-------------------------+ 719 | TLS Negotiation | -> <- | TLS Negotiation | 720 | (as client) | | (as server) | 721 +-------------------------+ +-------------------------+ 723 ... secured TCPCL messaging, starting with SESS_INIT ... 725 +-------------------------+ +-------------------------+ 726 | SESS_TERM | -> <- | SESS_TERM | 727 +-------------------------+ +-------------------------+ 729 Figure 5: A simple visual example of TCPCL TLS Establishment between 730 two entities 732 4.5. Message Type Codes 734 After the initial exchange of a contact header, all messages 735 transmitted over the session are identified by a one-octet header 736 with the following structure: 738 0 1 2 3 4 5 6 7 739 +---------------+ 740 | Message Type | 741 +---------------+ 743 Figure 6: Format of the Message Header 745 The message header fields are as follows: 747 Message Type: Indicates the type of the message as per Table 2 748 below. Encoded values are listed in Section 9.5. 750 +--------------+----------------------------------------------------+ 751 | Type | Description | 752 +--------------+----------------------------------------------------+ 753 | SESS_INIT | Contains the session parameter inputs from one of | 754 | | the entities, as described in Section 4.6. | 755 | | | 756 | XFER_INIT | Contains the length (in octets) of the next | 757 | | transfer, as described in Section 5.2.2. | 758 | | | 759 | XFER_SEGMENT | Indicates the transmission of a segment of bundle | 760 | | data, as described in Section 5.2.3. | 761 | | | 762 | XFER_ACK | Acknowledges reception of a data segment, as | 763 | | described in Section 5.2.4. | 764 | | | 765 | XFER_REFUSE | Indicates that the transmission of the current | 766 | | bundle SHALL be stopped, as described in Section | 767 | | 5.2.5. | 768 | | | 769 | KEEPALIVE | Used to keep TCPCL session active, as described in | 770 | | Section 5.1.1. | 771 | | | 772 | SESS_TERM | Indicates that one of the entities participating | 773 | | in the session wishes to cleanly terminate the | 774 | | session, as described in Section 6. | 775 | | | 776 | MSG_REJECT | Contains a TCPCL message rejection, as described | 777 | | in Section 5.1.2. | 778 +--------------+----------------------------------------------------+ 780 Table 2: TCPCL Message Types 782 4.6. Session Initialization Message (SESS_INIT) 784 Before a session is established and ready to transfer bundles, the 785 session parameters are negotiated between the connected entities. 786 The SESS_INIT message is used to convey the per-entity parameters 787 which are used together to negotiate the per-session parameters. 789 The format of a SESS_INIT message is as follows in Figure 7. 791 +-------------------------------+ 792 | Message Header | 793 +-------------------------------+ 794 | Keepalive Interval (U16) | 795 +-------------------------------+ 796 | Segment MRU (U64) | 797 +-------------------------------+ 798 | Transfer MRU (U64) | 799 +-------------------------------+ 800 | EID Length (U16) | 801 +-------------------------------+ 802 | EID Data (variable) | 803 +-------------------------------+ 804 | Session Extension Length (U64)| 805 +-------------------------------+ 806 | Session Extension Items (var.)| 807 +-------------------------------+ 809 Figure 7: SESS_INIT Format 811 A 16-bit unsigned integer indicating the interval, in seconds, 812 between any subsequent messages being transmitted by the peer. 813 The peer receiving this contact header uses this interval to 814 determine how long to wait after any last-message transmission and 815 a necessary subsequent KEEPALIVE message transmission. 817 A 64-bit unsigned integer indicating the largest allowable single- 818 segment data payload size to be received in this session. Any 819 XFER_SEGMENT sent to this peer SHALL have a data payload no longer 820 than the peer's Segment MRU. The two entities of a single session 821 MAY have different Segment MRUs, and no relation between the two 822 is required. 824 A 64-bit unsigned integer indicating the largest allowable total- 825 bundle data size to be received in this session. Any bundle 826 transfer sent to this peer SHALL have a Total Bundle Length 827 payload no longer than the peer's Transfer MRU. This value can be 828 used to perform proactive bundle fragmentation. The two entities 829 of a single session MAY have different Transfer MRUs, and no 830 relation between the two is required. 832 Together these fields represent a variable-length text string. 833 The EID Length is a 16-bit unsigned integer indicating the number 834 of octets of EID Data to follow. A zero EID Length SHALL be used 835 to indicate the lack of EID rather than a truly empty EID. This 836 case allows an entity to avoid exposing EID information on an 837 untrusted network. A non-zero-length EID Data SHALL contain the 838 UTF-8 encoded EID of some singleton endpoint in which the sending 839 entity is a member, in the canonical format of :. This EID encoding is consistent 841 with [I-D.ietf-dtn-bpbis]. 843 Together these fields represent protocol extension data not 844 defined by this specification. The Session Extension Length is 845 the total number of octets to follow which are used to encode the 846 Session Extension Item list. The encoding of each Session 847 Extension Item is within a consistent data container as described 848 in Section 4.6.1. The full set of Session Extension Items apply 849 for the duration of the TCPCL session to follow. The order and 850 mulitplicity of these Session Extension Items MAY be significant, 851 as defined in the associated type specification(s). 853 4.6.1. Session Extension Items 855 Each of the Session Extension Items SHALL be encoded in an identical 856 Type-Length-Value (TLV) container form as indicated in Figure 8. The 857 fields of the Session Extension Item are: 859 Flags: A one-octet field containing generic bit flags about the 860 Item, which are listed in Table 3. If a TCPCL entity receives a 861 Session Extension Item with an unknown Item Type and the CRITICAL 862 flag set, the entity SHALL close the TCPCL session with SESS_TERM 863 reason code of "Contact Failure". If the CRITICAL flag is not 864 set, an entity SHALL skip over and ignore any item with an unknown 865 Item Type. 867 Item Type: A 16-bit unsigned integer field containing the type of 868 the extension item. This specification does not define any 869 extension types directly, but does allocate an IANA registry for 870 such codes (see Section 9.3). 872 Item Length: A 32-bit unsigned integer field containing the number 873 of Item Value octets to follow. 875 Item Value: A variable-length data field which is interpreted 876 according to the associated Item Type. This specification places 877 no restrictions on an extension's use of available Item Value 878 data. Extension specification SHOULD avoid the use of large data 879 exchanges within the TCPCL contact header as no bundle transfers 880 can begin until the full contact exchange and negotiation has been 881 completed. 883 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 884 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 885 +---------------+---------------+---------------+---------------+ 886 | Item Flags | Item Type | Item Length...| 887 +---------------+---------------+---------------+---------------+ 888 | length contd. | Item Value... | 889 +---------------+---------------+---------------+---------------+ 890 | value contd. | 891 +---------------+---------------+---------------+---------------+ 893 Figure 8: Session Extension Item Format 895 +----------+--------+-----------------------------------------------+ 896 | Name | Code | Description | 897 +----------+--------+-----------------------------------------------+ 898 | CRITICAL | 0x01 | If bit is set, indicates that the receiving | 899 | | | peer must handle the extension item. | 900 | | | | 901 | Reserved | others | 902 +----------+--------+-----------------------------------------------+ 904 Table 3: Session Extension Item Flags 906 4.7. Session Parameter Negotiation 908 An entity calculates the parameters for a TCPCL session by 909 negotiating the values from its own preferences (conveyed by the 910 contact header it sent to the peer) with the preferences of the peer 911 node (expressed in the contact header that it received from the 912 peer). The negotiated parameters defined by this specification are 913 described in the following paragraphs. 915 Transfer MTU and Segment MTU: The maximum transmit unit (MTU) for 916 whole transfers and individual segments are idententical to the 917 Transfer MRU and Segment MRU, respectively, of the recevied 918 contact header. A transmitting peer can send individual segments 919 with any size smaller than the Segment MTU, depending on local 920 policy, dynamic network conditions, etc. Determining the size of 921 each transmitted segment is an implementation matter. 923 Session Keepalive: Negotiation of the Session Keepalive parameter is 924 performed by taking the minimum of this two contact headers' 925 Keepalive Interval. The Session Keepalive interval is a parameter 926 for the behavior described in Section 5.1.1. 928 Enable TLS: Negotiation of the Enable TLS parameter is performed by 929 taking the logical AND of the two contact headers' CAN_TLS flags. 930 A local security policy is then applied to determine of the 931 negotated value of Enable TLS is acceptable. If not, the node 932 SHALL shutdown the session with a reason code of "Contact 933 Failure". Note that this contact failure is different than a "TLS 934 Failure" after an agreed-upon and acceptable Enable TLS state. If 935 the negotiated Enable TLS value is true and acceptable then TLS 936 negotiation feature (described in Section 4.4) begins immediately 937 following the contact header exchange. 939 Once this process of parameter negotiation is completed (which 940 includes a possible completed TLS handshake of the connection to use 941 TLS), this protocol defines no additional mechanism to change the 942 parameters of an established session; to effect such a change, the 943 TCPCL session MUST be terminated and a new session established. 945 5. Established Session Operation 947 This section describes the protocol operation for the duration of an 948 established session, including the mechanism for transmitting bundles 949 over the session. 951 5.1. Upkeep and Status Messages 953 5.1.1. Session Upkeep (KEEPALIVE) 955 The protocol includes a provision for transmission of KEEPALIVE 956 messages over the TCPCL session to help determine if the underlying 957 TCP connection has been disrupted. 959 As described in Section 4.3, a negotiated parameter of each session 960 is the Session Keepalive interval. If the negotiated Session 961 Keepalive is zero (i.e. one or both contact headers contains a zero 962 Keepalive Interval), then the keepalive feature is disabled. There 963 is no logical minimum value for the keepalive interval, but when used 964 for many sessions on an open, shared network a short interval could 965 lead to excessive traffic. For shared network use, entities SHOULD 966 choose a keepalive interval no shorter than 30 seconds. There is no 967 logical maximum value for the keepalive interval, but an idle TCP 968 connection is liable for closure by the host operating system if the 969 keepalive time is longer than tens-of-minutes. Entities SHOULD 970 choose a keepalive interval no longer than 10 minutes (600 seconds). 972 Note: The Keepalive Interval SHOULD NOT be chosen too short as TCP 973 retransmissions MAY occur in case of packet loss. Those will have to 974 be triggered by a timeout (TCP retransmission timeout (RTO)), which 975 is dependent on the measured RTT for the TCP connection so that 976 KEEPALIVE messages MAY experience noticeable latency. 978 The format of a KEEPALIVE message is a one-octet message type code of 979 KEEPALIVE (as described in Table 2) with no additional data. Both 980 sides SHOULD send a KEEPALIVE message whenever the negotiated 981 interval has elapsed with no transmission of any message (KEEPALIVE 982 or other). 984 If no message (KEEPALIVE or other) has been received in a session 985 after some implementation-defined time duration, then the node MAY 986 terminate the session by transmitting a SESS_TERM message (as 987 described in Section 6.1) with reason code "Idle Timeout. 989 5.1.2. Message Rejection (MSG_REJECT) 991 If a TCPCL node receives a message which is unknown to it (possibly 992 due to an unhandled protocol mismatch) or is inappropriate for the 993 current session state (e.g. a KEEPALIVE message received after 994 contact header negotiation has disabled that feature), there is a 995 protocol-level message to signal this condition in the form of a 996 MSG_REJECT reply. 998 The format of a MSG_REJECT message is as follows in Figure 9. 1000 +-----------------------------+ 1001 | Message Header | 1002 +-----------------------------+ 1003 | Reason Code (U8) | 1004 +-----------------------------+ 1005 | Rejected Message Header | 1006 +-----------------------------+ 1008 Figure 9: Format of MSG_REJECT Messages 1010 The fields of the MSG_REJECT message are: 1012 Reason Code: A one-octet refusal reason code interpreted according 1013 to the descriptions in Table 4. 1015 Rejected Message Header: The Rejected Message Header is a copy of 1016 the Message Header to which the MSG_REJECT message is sent as a 1017 response. 1019 +-------------+------+----------------------------------------------+ 1020 | Name | Code | Description | 1021 +-------------+------+----------------------------------------------+ 1022 | Message | 0x01 | A message was received with a Message Type | 1023 | Type | | code unknown to the TCPCL node. | 1024 | Unknown | | | 1025 | | | | 1026 | Message | 0x02 | A message was received but the TCPCL node | 1027 | Unsupported | | cannot comply with the message contents. | 1028 | | | | 1029 | Message | 0x03 | A message was received while the session is | 1030 | Unexpected | | in a state in which the message is not | 1031 | | | expected. | 1032 +-------------+------+----------------------------------------------+ 1034 Table 4: MSG_REJECT Reason Codes 1036 5.2. Bundle Transfer 1038 All of the messages in this section are directly associated with 1039 transferring a bundle between TCPCL entities. 1041 A single TCPCL transfer results in a bundle (handled by the 1042 convergence layer as opaque data) being exchanged from one node to 1043 the other. In TCPCL a transfer is accomplished by dividing a single 1044 bundle up into "segments" based on the receiving-side Segment MRU 1045 (see Section 4.2). The choice of the length to use for segments is 1046 an implementation matter, but each segment MUST be no larger than the 1047 receiving node's maximum receive unit (MRU) (see the field "Segment 1048 MRU" of Section 4.2). The first segment for a bundle MUST set the 1049 'START' flag, and the last one MUST set the 'end' flag in the 1050 XFER_SEGMENT message flags. 1052 A single transfer (and by extension a single segment) SHALL NOT 1053 contain data of more than a single bundle. This requirement is 1054 imposed on the agent using the TCPCL rather than TCPCL itself. 1056 If multiple bundles are transmitted on a single TCPCL connection, 1057 they MUST be transmitted consecutively without interleaving of 1058 segments from multiple bundles. 1060 5.2.1. Bundle Transfer ID 1062 Each of the bundle transfer messages contains a Transfer ID which is 1063 used to correlate messages (from both sides of a transfer) for each 1064 bundle. A Transfer ID does not attempt to address uniqueness of the 1065 bundle data itself and has no relation to concepts such as bundle 1066 fragmentation. Each invocation of TCPCL by the bundle protocol 1067 agent, requesting transmission of a bundle (fragmentary or 1068 otherwise), results in the initiation of a single TCPCL transfer. 1069 Each transfer entails the sending of a XFER_INIT message and some 1070 number of XFER_SEGMENT and XFER_ACK messages; all are correlated by 1071 the same Transfer ID. 1073 Transfer IDs from each node SHALL be unique within a single TCPCL 1074 session. The initial Transfer ID from each node SHALL have value 1075 zero. Subsequent Transfer ID values SHALL be incremented from the 1076 prior Transfer ID value by one. Upon exhaustion of the entire 64-bit 1077 Transfer ID space, the sending node SHALL terminate the session with 1078 SESS_TERM reason code "Resource Exhaustion". 1080 For bidirectional bundle transfers, a TCPCL node SHOULD NOT rely on 1081 any relation between Transfer IDs originating from each side of the 1082 TCPCL session. 1084 5.2.2. Transfer Initialization (XFER_INIT) 1086 The XFER_INIT message contains the total length, in octets, of the 1087 bundle data in the associated transfer. The total length is 1088 formatted as a 64-bit unsigned integer. 1090 The purpose of the XFER_INIT message is to allow entities to 1091 preemptively refuse bundles that would exceed their resources or to 1092 prepare storage on the receiving node for the upcoming bundle data. 1093 See Section 5.2.5 for details on when refusal based on XFER_INIT 1094 content is acceptable. 1096 The Total Bundle Length field within a XFER_INIT message SHALL be 1097 treated as authoritative by the receiver. If, for whatever reason, 1098 the actual total length of bundle data received differs from the 1099 value indicated by the XFER_INIT message, the receiver SHOULD treat 1100 the transmitted data as invalid. 1102 The format of the XFER_INIT message is as follows in Figure 10. 1104 +-----------------------------+ 1105 | Message Header | 1106 +-----------------------------+ 1107 | Transfer ID (U64) | 1108 +-----------------------------+ 1109 | Total Bundle Length (U64) | 1110 +-----------------------------+ 1111 | Transfer Extension | 1112 | Length (U64) | 1113 +-----------------------------+ 1114 | Transfer Extension Items... | 1115 +-----------------------------+ 1117 Figure 10: Format of XFER_INIT Messages 1119 The fields of the XFER_INIT message are: 1121 Transfer ID: A 64-bit unsigned integer identifying the transfer 1122 about to begin. 1124 Total Bundle Length: A 64-bit unsigned integer indicating the size 1125 of the data-to-be-transferred. 1127 Transfer Extension Length and Transfer Extension Items: Together 1128 these fields represent protocol extension data not defined by this 1129 specification. The Transfer Extension Length is the total number 1130 of octets to follow which are used to encode the Transfer 1131 Extension Item list. The encoding of each Transfer Extension Item 1132 is within a consistent data container as described in 1133 Section 5.2.2.1. The full set of transfer extension items apply 1134 only to the assoicated single transfer. The order and 1135 mulitplicity of these transfer extension items MAY be significant, 1136 as defined in the associated type specification(s). 1138 An XFER_INIT message SHALL be sent as the first message in a transfer 1139 sequence, before transmission of any XFER_SEGMENT messages for the 1140 same Transfer ID. XFER_INIT messages MUST NOT be sent unless the 1141 next XFER_SEGMENT message has the 'START' bit set to "1" (i.e., just 1142 before the start of a new transfer). 1144 5.2.2.1. Transfer Extension Items 1146 Each of the Transfer Extension Items SHALL be encoded in an identical 1147 Type-Length-Value (TLV) container form as indicated in Figure 11. 1148 The fields of the Transfer Extension Item are: 1150 Flags: A one-octet field containing generic bit flags about the 1151 Item, which are listed in Table 5. If a TCPCL node receives a 1152 Transfer Extension Item with an unknown Item Type and the CRITICAL 1153 flag set, the node SHALL close the TCPCL session with SESS_TERM 1154 reason code of "Contact Failure". If the CRITICAL flag is not 1155 set, an entity SHALL skip over and ignore any item with an unknown 1156 Item Type. 1158 Item Type: A 16-bit unsigned integer field containing the type of 1159 the extension item. This specification does not define any 1160 extension types directly, but does allocate an IANA registry for 1161 such codes (see Section 9.4). 1163 Item Length: A 32-bit unsigned integer field containing the number 1164 of Item Value octets to follow. 1166 Item Value: A variable-length data field which is interpreted 1167 according to the associated Item Type. This specification places 1168 no restrictions on an extension's use of available Item Value 1169 data. Extension specification SHOULD avoid the use of large data 1170 exchanges within the XFER_INIT as the associated transfer cannot 1171 begin until the full initialization message is sent. 1173 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 1174 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 1175 +---------------+---------------+---------------+---------------+ 1176 | Item Flags | Item Type | Item Length...| 1177 +---------------+---------------+---------------+---------------+ 1178 | length contd. | Item Value... | 1179 +---------------+---------------+---------------+---------------+ 1180 | value contd. | 1181 +---------------+---------------+---------------+---------------+ 1183 Figure 11: Transfer Extension Item Format 1185 +----------+--------+-----------------------------------------------+ 1186 | Name | Code | Description | 1187 +----------+--------+-----------------------------------------------+ 1188 | CRITICAL | 0x01 | If bit is set, indicates that the receiving | 1189 | | | peer must handle the extension item. | 1190 | | | | 1191 | Reserved | others | 1192 +----------+--------+-----------------------------------------------+ 1194 Table 5: Transfer Extension Item Flags 1196 5.2.3. Data Transmission (XFER_SEGMENT) 1198 Each bundle is transmitted in one or more data segments. The format 1199 of a XFER_SEGMENT message follows in Figure 12. 1201 +------------------------------+ 1202 | Message Header | 1203 +------------------------------+ 1204 | Message Flags (U8) | 1205 +------------------------------+ 1206 | Transfer ID (U64) | 1207 +------------------------------+ 1208 | Data length (U64) | 1209 +------------------------------+ 1210 | Data contents (octet string) | 1211 +------------------------------+ 1213 Figure 12: Format of XFER_SEGMENT Messages 1215 The fields of the XFER_SEGMENT message are: 1217 Message Flags: A one-octet field of single-bit flags, interpreted 1218 according to the descriptions in Table 6. 1220 Transfer ID: A 64-bit unsigned integer identifying the transfer 1221 being made. 1223 Data length: A 64-bit unsigned integer indicating the number of 1224 octets in the Data contents to follow. 1226 Data contents: The variable-length data payload of the message. 1228 +----------+--------+-----------------------------------------------+ 1229 | Name | Code | Description | 1230 +----------+--------+-----------------------------------------------+ 1231 | END | 0x01 | If bit is set, indicates that this is the | 1232 | | | last segment of the transfer. | 1233 | | | | 1234 | START | 0x02 | If bit is set, indicates that this is the | 1235 | | | first segment of the transfer. | 1236 | | | | 1237 | Reserved | others | 1238 +----------+--------+-----------------------------------------------+ 1240 Table 6: XFER_SEGMENT Flags 1242 The flags portion of the message contains two optional values in the 1243 two low-order bits, denoted 'START' and 'END' in Table 6. The 1244 'START' bit MUST be set to one if it precedes the transmission of the 1245 first segment of a transfer. The 'END' bit MUST be set to one when 1246 transmitting the last segment of a transfer. In the case where an 1247 entire transfer is accomplished in a single segment, both the 'START' 1248 and 'END' bits MUST be set to one. 1250 Once a transfer of a bundle has commenced, the node MUST only send 1251 segments containing sequential portions of that bundle until it sends 1252 a segment with the 'END' bit set. No interleaving of multiple 1253 transfers from the same node is possible within a single TCPCL 1254 session. Simultaneous transfers between two entities MAY be achieved 1255 using multiple TCPCL sessions. 1257 5.2.4. Data Acknowledgments (XFER_ACK) 1259 Although the TCP transport provides reliable transfer of data between 1260 transport peers, the typical BSD sockets interface provides no means 1261 to inform a sending application of when the receiving application has 1262 processed some amount of transmitted data. Thus, after transmitting 1263 some data, the TCPCL needs an additional mechanism to determine 1264 whether the receiving agent has successfully received the segment. 1265 To this end, the TCPCL protocol provides feedback messaging whereby a 1266 receiving node transmits acknowledgments of reception of data 1267 segments. 1269 The format of an XFER_ACK message follows in Figure 13. 1271 +-----------------------------+ 1272 | Message Header | 1273 +-----------------------------+ 1274 | Message Flags (U8) | 1275 +-----------------------------+ 1276 | Transfer ID (U64) | 1277 +-----------------------------+ 1278 | Acknowledged length (U64) | 1279 +-----------------------------+ 1281 Figure 13: Format of XFER_ACK Messages 1283 The fields of the XFER_ACK message are: 1285 Message Flags: A one-octet field of single-bit flags, interpreted 1286 according to the descriptions in Table 6. 1288 Transfer ID: A 64-bit unsigned integer identifying the transfer 1289 being acknowledged. 1291 Acknowledged length: A 64-bit unsigned integer indicating the total 1292 number of octets in the transfer which are being acknowledged. 1294 A receiving TCPCL node SHALL send an XFER_ACK message in response to 1295 each received XFER_SEGMENT message. The flags portion of the 1296 XFER_ACK header SHALL be set to match the corresponding DATA_SEGMENT 1297 message being acknowledged. The acknowledged length of each XFER_ACK 1298 contains the sum of the data length fields of all XFER_SEGMENT 1299 messages received so far in the course of the indicated transfer. 1300 The sending node MAY transmit multiple XFER_SEGMENT messages without 1301 necessarily waiting for the corresponding XFER_ACK responses. This 1302 enables pipelining of messages on a channel. 1304 For example, suppose the sending node transmits four segments of 1305 bundle data with lengths 100, 200, 500, and 1000, respectively. 1306 After receiving the first segment, the node sends an acknowledgment 1307 of length 100. After the second segment is received, the node sends 1308 an acknowledgment of length 300. The third and fourth 1309 acknowledgments are of length 800 and 1800, respectively. 1311 5.2.5. Transfer Refusal (XFER_REFUSE) 1313 The TCPCL supports a mechanism by which a receiving node can indicate 1314 to the sender that it does not want to receive the corresponding 1315 bundle. To do so, upon receiving a XFER_INIT or XFER_SEGMENT 1316 message, the node MAY transmit a XFER_REFUSE message. As data 1317 segments and acknowledgments MAY cross on the wire, the bundle that 1318 is being refused SHALL be identified by the Transfer ID of the 1319 refusal. 1321 There is no required relation between the Transfer MRU of a TCPCL 1322 node (which is supposed to represent a firm limitation of what the 1323 node will accept) and sending of a XFER_REFUSE message. A 1324 XFER_REFUSE can be used in cases where the agent's bundle storage is 1325 temporarily depleted or somehow constrained. A XFER_REFUSE can also 1326 be used after the bundle header or any bundle data is inspected by an 1327 agent and determined to be unacceptable. 1329 A receiver MAY send an XFER_REFUSE message as soon as it receives a 1330 XFER_INIT message without waiting for the next XFER_SEGMENT message. 1331 The sender MUST be prepared for this and MUST associate the refusal 1332 with the correct bundle via the Transfer ID fields. 1334 The format of the XFER_REFUSE message is as follows in Figure 14. 1336 +-----------------------------+ 1337 | Message Header | 1338 +-----------------------------+ 1339 | Reason Code (U8) | 1340 +-----------------------------+ 1341 | Transfer ID (U64) | 1342 +-----------------------------+ 1344 Figure 14: Format of XFER_REFUSE Messages 1346 The fields of the XFER_REFUSE message are: 1348 Reason Code: A one-octet refusal reason code interpreted according 1349 to the descriptions in Table 7. 1351 Transfer ID: A 64-bit unsigned integer identifying the transfer 1352 being refused. 1354 +------------+------------------------------------------------------+ 1355 | Name | Semantics | 1356 +------------+------------------------------------------------------+ 1357 | Unknown | Reason for refusal is unknown or not specified. | 1358 | | | 1359 | Completed | The receiver already has the complete bundle. The | 1360 | | sender MAY consider the bundle as completely | 1361 | | received. | 1362 | | | 1363 | No | The receiver's resources are exhausted. The sender | 1364 | Resources | SHOULD apply reactive bundle fragmentation before | 1365 | | retrying. | 1366 | | | 1367 | Retransmit | The receiver has encountered a problem that requires | 1368 | | the bundle to be retransmitted in its entirety. | 1369 +------------+------------------------------------------------------+ 1371 Table 7: XFER_REFUSE Reason Codes 1373 The receiver MUST, for each transfer preceding the one to be refused, 1374 have either acknowledged all XFER_SEGMENTs or refused the bundle 1375 transfer. 1377 The bundle transfer refusal MAY be sent before an entire data segment 1378 is received. If a sender receives a XFER_REFUSE message, the sender 1379 MUST complete the transmission of any partially sent XFER_SEGMENT 1380 message. There is no way to interrupt an individual TCPCL message 1381 partway through sending it. The sender MUST NOT commence 1382 transmission of any further segments of the refused bundle 1383 subsequently. Note, however, that this requirement does not ensure 1384 that an entity will not receive another XFER_SEGMENT for the same 1385 bundle after transmitting a XFER_REFUSE message since messages MAY 1386 cross on the wire; if this happens, subsequent segments of the bundle 1387 SHOULD also be refused with a XFER_REFUSE message. 1389 Note: If a bundle transmission is aborted in this way, the receiver 1390 MAY not receive a segment with the 'END' flag set to '1' for the 1391 aborted bundle. The beginning of the next bundle is identified by 1392 the 'START' bit set to '1', indicating the start of a new transfer, 1393 and with a distinct Transfer ID value. 1395 6. Session Termination 1397 This section describes the procedures for ending a TCPCL session. 1399 6.1. Session Termination Message (SESS_TERM) 1401 To cleanly shut down a session, a SESS_TERM message SHALL be 1402 transmitted by either node at any point following complete 1403 transmission of any other message. Upon receiving a SESS_TERM 1404 message after not sending a SESS_TERM message in the same session, an 1405 entity SHOULD send a confirmation SESS_TERM message with identical 1406 content to the SESS_TERM for which it is confirming. 1408 After sending a SESS_TERM message, an entity MAY continue a possible 1409 in-progress transfer in either direction. After sending a SESS_TERM 1410 message, an entity SHALL NOT begin any new outgoing transfer (i.e. 1411 send an XFER_INIT message) for the remainder of the session. After 1412 receving a SESS_TERM message, an entity SHALL NOT accept any new 1413 incoming transfer for the remainder of the session. 1415 Instead of following a clean shutdown sequence, after transmitting a 1416 SESS_TERM message an entity MAY immediately close the associated TCP 1417 connection. When performing an unclean shutdown, a receiving node 1418 SHOULD acknowledge all received data segments before closing the TCP 1419 connection. When performing an unclean shutodwn, a transmitting node 1420 SHALL treat either sending or receiving a SESS_TERM message (i.e. 1421 before the final acknowledgment) as a failure of the transfer. Any 1422 delay between request to terminate the TCP connection and actual 1423 closing of the connection (a "half-closed" state) MAY be ignored by 1424 the TCPCL node. 1426 The format of the SESS_TERM message is as follows in Figure 15. 1428 +-----------------------------------+ 1429 | Message Header | 1430 +-----------------------------------+ 1431 | Message Flags (U8) | 1432 +-----------------------------------+ 1433 | Reason Code (optional U8) | 1434 +-----------------------------------+ 1436 Figure 15: Format of SESS_TERM Messages 1438 The fields of the SESS_TERM message are: 1440 Message Flags: A one-octet field of single-bit flags, interpreted 1441 according to the descriptions in Table 8. 1443 Reason Code: A one-octet refusal reason code interpreted according 1444 to the descriptions in Table 9. The Reason Code is present or 1445 absent as indicated by one of the flags. 1447 +----------+--------+-----------------------------------------------+ 1448 | Name | Code | Description | 1449 +----------+--------+-----------------------------------------------+ 1450 | R | 0x02 | If bit is set, indicates that a Reason Code | 1451 | | | field is present. | 1452 | | | | 1453 | Reserved | others | 1454 +----------+--------+-----------------------------------------------+ 1456 Table 8: SESS_TERM Flags 1458 It is possible for an entity to convey optional information regarding 1459 the reason for session termination. To do so, the node MUST set the 1460 'R' bit in the message flags and transmit a one-octet reason code 1461 immediately following the message header. The specified values of 1462 the reason code are: 1464 +---------------+---------------------------------------------------+ 1465 | Name | Description | 1466 +---------------+---------------------------------------------------+ 1467 | Idle timeout | The session is being closed due to idleness. | 1468 | | | 1469 | Version | The node cannot conform to the specified TCPCL | 1470 | mismatch | protocol version. | 1471 | | | 1472 | Busy | The node is too busy to handle the current | 1473 | | session. | 1474 | | | 1475 | Contact | The node cannot interpret or negotiate contact | 1476 | Failure | header option. | 1477 | | | 1478 | TLS Failure | The node failed to negotiate TLS session and | 1479 | | cannot continue the session. | 1480 | | | 1481 | Resource | The node has run into some resource limit and | 1482 | Exhaustion | cannot continue the session. | 1483 +---------------+---------------------------------------------------+ 1485 Table 9: SESS_TERM Reason Codes 1487 A session shutdown MAY occur immediately after transmission of a 1488 contact header (and prior to any further message transmit). This 1489 MAY, for example, be used to notify that the node is currently not 1490 able or willing to communicate. However, an entity MUST always send 1491 the contact header to its peer before sending a SESS_TERM message. 1493 If reception of the contact header itself somehow fails (e.g. an 1494 invalid "magic string" is recevied), an entity SHOULD close the TCP 1495 connection without sending a SESS_TERM message. If the content of 1496 the Session Extension Items data disagrees with the Session Extension 1497 Length (i.e. the last Item claims to use more octets than are present 1498 in the Session Extension Length), the reception of the contact header 1499 is considered to have failed. 1501 If a session is to be terminated before a protocol message has 1502 completed being sent, then the node MUST NOT transmit the SESS_TERM 1503 message but still SHOULD close the TCP connection. Each TCPCL 1504 message is contiguous in the octet stream and has no ability to be 1505 cut short and/or preempted by an other message. This is particularly 1506 important when large segment sizes are being transmitted; either 1507 entire XFER_SEGMENT is sent before a SESS_TERM message or the 1508 connection is simply terminated mid-XFER_SEGMENT. 1510 6.2. Idle Session Shutdown 1512 The protocol includes a provision for clean shutdown of idle 1513 sessions. Determining the length of time to wait before closing idle 1514 sessions, if they are to be closed at all, is an implementation and 1515 configuration matter. 1517 If there is a configured time to close idle links and if no TCPCL 1518 messages (other than KEEPALIVE messages) has been received for at 1519 least that amount of time, then either node MAY terminate the session 1520 by transmitting a SESS_TERM message indicating the reason code of 1521 "Idle timeout" (as described in Table 9). 1523 7. Implementation Status 1525 [NOTE to the RFC Editor: please remove this section before 1526 publication, as well as the reference to [RFC7942] and 1527 [github-dtn-bpbis-tcpcl].] 1529 This section records the status of known implementations of the 1530 protocol defined by this specification at the time of posting of this 1531 Internet-Draft, and is based on a proposal described in [RFC7942]. 1532 The description of implementations in this section is intended to 1533 assist the IETF in its decision processes in progressing drafts to 1534 RFCs. Please note that the listing of any individual implementation 1535 here does not imply endorsement by the IETF. Furthermore, no effort 1536 has been spent to verify the information presented here that was 1537 supplied by IETF contributors. This is not intended as, and must not 1538 be construed to be, a catalog of available implementations or their 1539 features. Readers are advised to note that other implementations may 1540 exist. 1542 An example implementation of the this draft of TCPCLv4 has been 1543 created as a GitHub project [github-dtn-bpbis-tcpcl] and is intented 1544 to use as a proof-of-concept and as a possible source of 1545 interoperability testing. This example implementation uses D-Bus as 1546 the CL-BP Agent interface, so it only runs on hosts which provide the 1547 Python "dbus" library. 1549 8. Security Considerations 1551 One security consideration for this protocol relates to the fact that 1552 entities present their endpoint identifier as part of the contact 1553 header exchange. It would be possible for an entity to fake this 1554 value and present the identity of a singleton endpoint in which the 1555 node is not a member, essentially masquerading as another DTN node. 1556 If this identifier is used outside of a TLS-secured session or 1557 without further verification as a means to determine which bundles 1558 are transmitted over the session, then the node that has falsified 1559 its identity would be able to obtain bundles that it otherwise would 1560 not have. Therefore, an entity SHALL NOT use the EID value of an 1561 unsecured contact header to derive a peer node's identity unless it 1562 can corroborate it via other means. When TCPCL session security is 1563 mandated by a TCPCL peer, that peer SHALL transmit initial unsecured 1564 contact header values indicated in Table 10 in order. These values 1565 avoid unnecessarily leaking session parameters and will be ignored 1566 when secure contact header re-exchange occurs. 1568 +--------------------+---------------------------------------------+ 1569 | Parameter | Value | 1570 +--------------------+---------------------------------------------+ 1571 | Flags | The USE_TLS flag is set. | 1572 | | | 1573 | Keepalive Interval | Zero, indicating no keepalive. | 1574 | | | 1575 | Segment MRU | Zero, indicating all segments are refused. | 1576 | | | 1577 | Transfer MRU | Zero, indicating all transfers are refused. | 1578 | | | 1579 | EID | Empty, indicating lack of EID. | 1580 +--------------------+---------------------------------------------+ 1582 Table 10: Recommended Unsecured Contact Header 1584 TCPCL can be used to provide point-to-point transport security, but 1585 does not provide security of data-at-rest and does not guarantee end- 1586 to-end bundle security. The mechanisms defined in [RFC6257] and 1587 [I-D.ietf-dtn-bpsec] are to be used instead. 1589 Even when using TLS to secure the TCPCL session, the actual 1590 ciphersuite negotiated between the TLS peers MAY be insecure. TLS 1591 can be used to perform authentication without data confidentiality, 1592 for example. It is up to security policies within each TCPCL node to 1593 ensure that the negotiated TLS ciphersuite meets transport security 1594 requirements. This is identical behavior to STARTTLS use in 1595 [RFC2595]. 1597 Another consideration for this protocol relates to denial-of-service 1598 attacks. An entity MAY send a large amount of data over a TCPCL 1599 session, requiring the receiving entity to handle the data, attempt 1600 to stop the flood of data by sending a XFER_REFUSE message, or 1601 forcibly terminate the session. This burden could cause denial of 1602 service on other, well-behaving sessions. There is also nothing to 1603 prevent a malicious entity from continually establishing sessions and 1604 repeatedly trying to send copious amounts of bundle data. A 1605 listening entity MAY take countermeasures such as ignoring TCP SYN 1606 messages, closing TCP connections as soon as they are established, 1607 waiting before sending the contact header, sending a SESS_TERM 1608 message quickly or with a delay, etc. 1610 9. IANA Considerations 1612 In this section, registration procedures are as defined in [RFC5226]. 1614 Some of the registries below are created new for TCPCLv4 but share 1615 code values with TCPCLv3. This was done to disambiguate the use of 1616 these values between TCPCLv3 and TCPCLv4 while preserving the 1617 semantics of some values. 1619 9.1. Port Number 1621 Port number 4556 has been previously assigned as the default port for 1622 the TCP convergence layer in [RFC7242]. This assignment is unchanged 1623 by protocol version 4. Each TCPCL entity identifies its TCPCL 1624 protocol version in its initial contact (see Section 9.2), so there 1625 is no ambiguity about what protocol is being used. 1627 +------------------------+-------------------------------------+ 1628 | Parameter | Value | 1629 +------------------------+-------------------------------------+ 1630 | Service Name: | dtn-bundle | 1631 | | | 1632 | Transport Protocol(s): | TCP | 1633 | | | 1634 | Assignee: | Simon Perreault | 1635 | | | 1636 | Contact: | Simon Perreault | 1637 | | | 1638 | Description: | DTN Bundle TCP CL Protocol | 1639 | | | 1640 | Reference: | [RFC7242] | 1641 | | | 1642 | Port Number: | 4556 | 1643 +------------------------+-------------------------------------+ 1645 9.2. Protocol Versions 1647 IANA has created, under the "Bundle Protocol" registry, a sub- 1648 registry titled "Bundle Protocol TCP Convergence-Layer Version 1649 Numbers" and initialize it with the following table. The 1650 registration procedure is RFC Required. 1652 +-------+-------------+---------------------+ 1653 | Value | Description | Reference | 1654 +-------+-------------+---------------------+ 1655 | 0 | Reserved | [RFC7242] | 1656 | | | | 1657 | 1 | Reserved | [RFC7242] | 1658 | | | | 1659 | 2 | Reserved | [RFC7242] | 1660 | | | | 1661 | 3 | TCPCL | [RFC7242] | 1662 | | | | 1663 | 4 | TCPCLbis | This specification. | 1664 | | | | 1665 | 5-255 | Unassigned | 1666 +-------+-------------+---------------------+ 1668 9.3. Session Extension Types 1670 EDITOR NOTE: sub-registry to-be-created upon publication of this 1671 specification. 1673 IANA will create, under the "Bundle Protocol" registry, a sub- 1674 registry titled "Bundle Protocol TCP Convergence-Layer Version 4 1675 Session Extension Types" and initialize it with the contents of 1676 Table 11. The registration procedure is RFC Required within the 1677 lower range 0x0001--0x7fff. Values in the range 0x8000--0xffff are 1678 reserved for use on private networks for functions not published to 1679 the IANA. 1681 +----------------+--------------------------+ 1682 | Code | Message Type | 1683 +----------------+--------------------------+ 1684 | 0x0000 | Reserved | 1685 | | | 1686 | 0x0001--0x7fff | Unassigned | 1687 | | | 1688 | 0x8000--0xffff | Private/Experimental Use | 1689 +----------------+--------------------------+ 1691 Table 11: Session Extension Type Codes 1693 9.4. Transfer Extension Types 1695 EDITOR NOTE: sub-registry to-be-created upon publication of this 1696 specification. 1698 IANA will create, under the "Bundle Protocol" registry, a sub- 1699 registry titled "Bundle Protocol TCP Convergence-Layer Version 4 1700 Transfer Extension Types" and initialize it with the contents of 1701 Table 12. The registration procedure is RFC Required within the 1702 lower range 0x0001--0x7fff. Values in the range 0x8000--0xffff are 1703 reserved for use on private networks for functions not published to 1704 the IANA. 1706 +----------------+--------------------------+ 1707 | Code | Message Type | 1708 +----------------+--------------------------+ 1709 | 0x0000 | Reserved | 1710 | | | 1711 | 0x0001--0x7fff | Unassigned | 1712 | | | 1713 | 0x8000--0xffff | Private/Experimental Use | 1714 +----------------+--------------------------+ 1716 Table 12: Transfer Extension Type Codes 1718 9.5. Message Types 1720 EDITOR NOTE: sub-registry to-be-created upon publication of this 1721 specification. 1723 IANA will create, under the "Bundle Protocol" registry, a sub- 1724 registry titled "Bundle Protocol TCP Convergence-Layer Version 4 1725 Message Types" and initialize it with the contents of Table 13. The 1726 registration procedure is RFC Required. 1728 +-----------+--------------+ 1729 | Code | Message Type | 1730 +-----------+--------------+ 1731 | 0x00 | Reserved | 1732 | | | 1733 | 0x01 | XFER_SEGMENT | 1734 | | | 1735 | 0x02 | XFER_ACK | 1736 | | | 1737 | 0x03 | XFER_REFUSE | 1738 | | | 1739 | 0x04 | KEEPALIVE | 1740 | | | 1741 | 0x05 | SESS_TERM | 1742 | | | 1743 | 0x06 | XFER_INIT | 1744 | | | 1745 | 0x07 | MSG_REJECT | 1746 | | | 1747 | 0x08--0xf | Unassigned | 1748 +-----------+--------------+ 1750 Table 13: Message Type Codes 1752 9.6. XFER_REFUSE Reason Codes 1754 EDITOR NOTE: sub-registry to-be-created upon publication of this 1755 specification. 1757 IANA will create, under the "Bundle Protocol" registry, a sub- 1758 registry titled "Bundle Protocol TCP Convergence-Layer Version 4 1759 XFER_REFUSE Reason Codes" and initialize it with the contents of 1760 Table 14. The registration procedure is RFC Required. 1762 +----------+---------------------------+ 1763 | Code | Refusal Reason | 1764 +----------+---------------------------+ 1765 | 0x0 | Unknown | 1766 | | | 1767 | 0x1 | Completed | 1768 | | | 1769 | 0x2 | No Resources | 1770 | | | 1771 | 0x3 | Retransmit | 1772 | | | 1773 | 0x4--0x7 | Unassigned | 1774 | | | 1775 | 0x8--0xf | Reserved for future usage | 1776 +----------+---------------------------+ 1778 Table 14: XFER_REFUSE Reason Codes 1780 9.7. SESS_TERM Reason Codes 1782 EDITOR NOTE: sub-registry to-be-created upon publication of this 1783 specification. 1785 IANA will create, under the "Bundle Protocol" registry, a sub- 1786 registry titled "Bundle Protocol TCP Convergence-Layer Version 4 1787 SESS_TERM Reason Codes" and initialize it with the contents of 1788 Table 15. The registration procedure is RFC Required. 1790 +------------+---------------------+ 1791 | Code | Shutdown Reason | 1792 +------------+---------------------+ 1793 | 0x00 | Idle timeout | 1794 | | | 1795 | 0x01 | Version mismatch | 1796 | | | 1797 | 0x02 | Busy | 1798 | | | 1799 | 0x03 | Contact Failure | 1800 | | | 1801 | 0x04 | TLS failure | 1802 | | | 1803 | 0x05 | Resource Exhaustion | 1804 | | | 1805 | 0x06--0xFF | Unassigned | 1806 +------------+---------------------+ 1808 Table 15: SESS_TERM Reason Codes 1810 9.8. MSG_REJECT Reason Codes 1812 EDITOR NOTE: sub-registry to-be-created upon publication of this 1813 specification. 1815 IANA will create, under the "Bundle Protocol" registry, a sub- 1816 registry titled "Bundle Protocol TCP Convergence-Layer Version 4 1817 MSG_REJECT Reason Codes" and initialize it with the contents of 1818 Table 16. The registration procedure is RFC Required. 1820 +-----------+----------------------+ 1821 | Code | Rejection Reason | 1822 +-----------+----------------------+ 1823 | 0x00 | reserved | 1824 | | | 1825 | 0x01 | Message Type Unknown | 1826 | | | 1827 | 0x02 | Message Unsupported | 1828 | | | 1829 | 0x03 | Message Unexpected | 1830 | | | 1831 | 0x04-0xFF | Unassigned | 1832 +-----------+----------------------+ 1834 Table 16: REJECT Reason Codes 1836 10. Acknowledgments 1838 This specification is based on comments on implementation of 1839 [RFC7242] provided from Scott Burleigh. 1841 11. References 1843 11.1. Normative References 1845 [I-D.ietf-dtn-bpbis] 1846 Burleigh, S., Fall, K., and E. Birrane, "Bundle Protocol 1847 Version 7", draft-ietf-dtn-bpbis-10 (work in progress), 1848 November 2017. 1850 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 1851 RFC 793, DOI 10.17487/RFC0793, September 1981, 1852 . 1854 [RFC1122] Braden, R., Ed., "Requirements for Internet Hosts - 1855 Communication Layers", STD 3, RFC 1122, 1856 DOI 10.17487/RFC1122, October 1989, 1857 . 1859 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1860 Requirement Levels", BCP 14, RFC 2119, 1861 DOI 10.17487/RFC2119, March 1997, 1862 . 1864 [RFC5050] Scott, K. and S. Burleigh, "Bundle Protocol 1865 Specification", RFC 5050, DOI 10.17487/RFC5050, November 1866 2007, . 1868 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1869 IANA Considerations Section in RFCs", RFC 5226, 1870 DOI 10.17487/RFC5226, May 2008, 1871 . 1873 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1874 (TLS) Protocol Version 1.2", RFC 5246, 1875 DOI 10.17487/RFC5246, August 2008, 1876 . 1878 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 1879 "Recommendations for Secure Use of Transport Layer 1880 Security (TLS) and Datagram Transport Layer Security 1881 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 1882 2015, . 1884 11.2. Informative References 1886 [github-dtn-bpbis-tcpcl] 1887 Sipos, B., "TCPCL Example Implementation", 1888 . 1891 [I-D.ietf-dtn-bpsec] 1892 Birrane, E. and K. McKeever, "Bundle Protocol Security 1893 Specification", draft-ietf-dtn-bpsec-06 (work in 1894 progress), October 2017. 1896 [RFC2595] Newman, C., "Using TLS with IMAP, POP3 and ACAP", 1897 RFC 2595, DOI 10.17487/RFC2595, June 1999, 1898 . 1900 [RFC4838] Cerf, V., Burleigh, S., Hooke, A., Torgerson, L., Durst, 1901 R., Scott, K., Fall, K., and H. Weiss, "Delay-Tolerant 1902 Networking Architecture", RFC 4838, DOI 10.17487/RFC4838, 1903 April 2007, . 1905 [RFC6257] Symington, S., Farrell, S., Weiss, H., and P. Lovell, 1906 "Bundle Security Protocol Specification", RFC 6257, 1907 DOI 10.17487/RFC6257, May 2011, 1908 . 1910 [RFC7242] Demmer, M., Ott, J., and S. Perreault, "Delay-Tolerant 1911 Networking TCP Convergence-Layer Protocol", RFC 7242, 1912 DOI 10.17487/RFC7242, June 2014, 1913 . 1915 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 1916 Code: The Implementation Status Section", BCP 205, 1917 RFC 7942, DOI 10.17487/RFC7942, July 2016, 1918 . 1920 Appendix A. Significant changes from RFC7242 1922 The areas in which changes from [RFC7242] have been made to existing 1923 headers and messages are: 1925 o Split contact header into pre-TLS protocol negotiation and 1926 SESS_INIT parameter negotiation. 1928 o Changed contact header content to limit number of negotiated 1929 options. 1931 o Added contact option to negotiate maximum segment size (per each 1932 direction). 1934 o Added session extension capability. 1936 o Added transfer extension capability. 1938 o Defined new IANA registries for message / type / reason codes to 1939 allow renaming some codes for clarity. 1941 o Expanded Message Header to octet-aligned fields instead of bit- 1942 packing. 1944 o Added a bundle transfer identification number to all bundle- 1945 related messages (XFER_INIT, XFER_SEGMENT, XFER_ACK, XFER_REFUSE). 1947 o Use flags in XFER_ACK to mirror flags from XFER_SEGMENT. 1949 o Removed all uses of SDNV fields and replaced with fixed-bit-length 1950 fields. 1952 o Renamed SHUTDOWN to SESS_TERM to deconflict term "shutdown". 1954 o Removed the notion of a re-connection delay parameter. 1956 The areas in which extensions from [RFC7242] have been made as new 1957 messages and codes are: 1959 o Added contact negotiation failure SESS_TERM reason code. 1961 o Added MSG_REJECT message to indicate an unknown or unhandled 1962 message was received. 1964 o Added TLS session security mechanism. 1966 o Added TLS failure and Resource Exhaustion SESS_TERM reason code. 1968 Authors' Addresses 1970 Brian Sipos 1971 RKF Engineering Solutions, LLC 1972 7500 Old Georgetown Road 1973 Suite 1275 1974 Bethesda, MD 20814-6198 1975 US 1977 Email: BSipos@rkf-eng.com 1979 Michael Demmer 1980 University of California, Berkeley 1981 Computer Science Division 1982 445 Soda Hall 1983 Berkeley, CA 94720-1776 1984 US 1986 Email: demmer@cs.berkeley.edu 1988 Joerg Ott 1989 Aalto University 1990 Department of Communications and Networking 1991 PO Box 13000 1992 Aalto 02015 1993 Finland 1995 Email: jo@netlab.tkk.fi 1996 Simon Perreault 1997 Quebec, QC 1998 Canada 2000 Email: simon@per.reau.lt