idnits 2.17.1 draft-wood-tsvwg-saratoga-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 1 instance of lines with multicast IPv4 addresses in the document. If these are generic example addresses, they should be changed to use the 233.252.0.x range defined in RFC 5771 == There are 1 instance of lines with non-RFC3849-compliant IPv6 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The exact meaning of the all-uppercase expression 'MAY NOT' is not defined in RFC 2119. If it is intended as a requirements expression, it should be rewritten using one of the combinations defined in RFC 2119; otherwise it should not be all-uppercase. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: Congestion control MUST be supported if Saratoga is being used across the public Internet, and SHOULD be supported in environments where links are shared by traffic flows. Congestion control MAY NOT be supported across private, single-flow links engineered for performance: Saratoga's primary use case. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (June 26, 2011) is 4688 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 3309 (Obsoleted by RFC 4960) == Outdated reference: A later version (-10) exists of draft-ietf-ledbat-congestion-06 == Outdated reference: A later version (-09) exists of draft-wood-dtnrg-http-dtn-delivery-07 == Outdated reference: A later version (-14) exists of draft-wood-dtnrg-saratoga-09 Summary: 1 error (**), 0 flaws (~~), 7 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group L. Wood 3 Internet-Draft University of Surrey 4 Intended status: Experimental W. Eddy 5 Expires: December 28, 2011 MTI Systems 6 C. Smith 7 CSIRO 8 W. Ivancic 9 NASA 10 C. Jackson 11 SSTL 12 June 26, 2011 14 Saratoga: A Scalable File Transfer Protocol 15 draft-wood-tsvwg-saratoga-09 17 Abstract 19 This document specifies the Saratoga transfer protocol. Saratoga was 20 originally developed to transfer remote-sensing imagery efficiently 21 from a low-Earth-orbiting satellite constellation, but is useful for 22 many other scenarios, including ad-hoc peer-to-peer communications, 23 delay-tolerant networking, and grid computing. Saratoga is a simple, 24 lightweight, content dissemination protocol that builds on UDP, and 25 optionally uses UDP-Lite. Saratoga is intended for use when moving 26 files or streaming data between peers which may have permanent, 27 sporadic or intermittent connectivity, and is capable of transferring 28 very large amounts of data reliably under adverse conditions. The 29 Saratoga protocol is designed to cope with highly asymmetric link or 30 path capacity between peers, and can support fully-unidirectional 31 data transfer if required. In scenarios with dedicated links, 32 Saratoga focuses on high link utilization to make the most of limited 33 connectivity times, while standard congestion control mechanisms can 34 be implemented for operation over shared links. Loss recovery is 35 implemented via a simple negative-ack ARQ mechanism. The protocol 36 specified in this document is considered to be appropriate for 37 experimental use on private IP networks. 39 Status of this Memo 41 This Internet-Draft is submitted to IETF in full conformance with the 42 provisions of BCP 78 and BCP 79. This document may not be modified, 43 and derivative works of it may not be created, except to format it 44 for publication as an RFC and to translate it into languages other 45 than English. 47 Internet-Drafts are working documents of the Internet Engineering 48 Task Force (IETF). Note that other groups may also distribute 49 working documents as Internet-Drafts. The list of current Internet- 50 Drafts is at http://datatracker.ietf.org/drafts/current/. 52 Internet-Drafts are draft documents valid for a maximum of six months 53 and may be updated, replaced, or obsoleted by other documents at any 54 time. It is inappropriate to use Internet-Drafts as reference 55 material or to cite them other than as "work in progress." 57 This Internet-Draft will expire on December 28, 2011. 59 Copyright Notice 61 Copyright (c) 2011 IETF Trust and the persons identified as the 62 document authors. All rights reserved. 64 This document is subject to BCP 78 and the IETF Trust's Legal 65 Provisions Relating to IETF Documents 66 (http://trustee.ietf.org/license-info) in effect on the date of 67 publication of this document. Please review these documents 68 carefully, as they describe your rights and restrictions with respect 69 to this document. Code Components extracted from this document must 70 include Simplified BSD License text as described in Section 4.e of 71 the Trust Legal Provisions and are provided without warranty as 72 described in the Simplified BSD License. 74 Table of Contents 76 1. Background and Introduction . . . . . . . . . . . . . . . . . 4 77 2. Overview of Saratoga File Transfer . . . . . . . . . . . . . . 6 78 3. Optional Parts of Saratoga . . . . . . . . . . . . . . . . . . 11 79 3.1. Optional but useful functions in Saratoga . . . . . . . . 11 80 3.2. Optional congestion control . . . . . . . . . . . . . . . 11 81 3.3. Optional functionality requiring other protocols . . . . . 12 82 4. Packet Types . . . . . . . . . . . . . . . . . . . . . . . . . 13 83 4.1. BEACON . . . . . . . . . . . . . . . . . . . . . . . . . . 15 84 4.2. REQUEST . . . . . . . . . . . . . . . . . . . . . . . . . 20 85 4.3. METADATA . . . . . . . . . . . . . . . . . . . . . . . . . 24 86 4.4. DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 87 4.5. STATUS . . . . . . . . . . . . . . . . . . . . . . . . . . 31 88 5. The Directory Entry . . . . . . . . . . . . . . . . . . . . . 38 89 6. Behaviour of a Saratoga Peer . . . . . . . . . . . . . . . . . 41 90 6.1. Saratoga Transactions . . . . . . . . . . . . . . . . . . 41 91 6.2. Beacons . . . . . . . . . . . . . . . . . . . . . . . . . 44 92 6.3. Upper-Layer Interface . . . . . . . . . . . . . . . . . . 45 93 6.4. Inactivity Timer . . . . . . . . . . . . . . . . . . . . . 45 94 7. Mailing list . . . . . . . . . . . . . . . . . . . . . . . . . 46 95 8. Security Considerations . . . . . . . . . . . . . . . . . . . 46 96 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 47 97 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 47 98 11. A Note on Naming . . . . . . . . . . . . . . . . . . . . . . . 47 99 12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 48 100 12.1. Normative References . . . . . . . . . . . . . . . . . . . 48 101 12.2. Informative References . . . . . . . . . . . . . . . . . . 48 102 Appendix A. Timestamp/Nonce field considerations . . . . . . . . 50 103 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 51 105 1. Background and Introduction 107 Saratoga is a file transfer and content dissemination protocol 108 capable of efficiently sending both small and very large files as 109 well as streaming continuous content. Saratoga was originally 110 designed for the purpose of large file transfer from small low-Earth- 111 orbit satellites. It has been used in daily operations since 2004 to 112 move mission imaging data files of the order of several hundred 113 megabytes each from the Disaster Monitoring Constellation (DMC) 114 remote-sensing satellites to ground stations. 116 The DMC satellites, built at the University of Surrey by Surrey 117 Satellite Technology Ltd (SSTL), all use IP for payload 118 communications and delivery of Earth imagery. At the time of this 119 writing, in June 2011, seven DMC satellites have been launched into 120 orbit since 2003, five of those are currently operational in orbit, 121 and two further DMC satellites are being readied for launch. The DMC 122 satellites use Saratoga to provide Earth imagery under the aegis of 123 the International Charter on Space and Major Disasters. A pass of 124 connectivity between a satellite and ground station offers an 8-12 125 minute time window in which to transfer imagery files using a minimum 126 of an 8.1 Mbps downlink and a 9.6 kbps uplink. The latest 127 operational DMC satellites have faster downlinks, capable of 20, 40 128 or 80 Mbps. Newer satellites are expected to provide 200 Mbps or 129 more, without significant increases in uplink rates. This high 130 degree of asymmetry, with the need to fully utilize the available 131 downlink capacity to move the volume of data required within the 132 limited time available, motivates much of Saratoga's design. 134 Further details on how these DMC satellites use IP to communicate 135 with the ground and the terrestrial Internet are discussed elsewhere 136 [Hogie05][Wood07a]. Saratoga is also being implemented for use in 137 high-speed private networks supporting radio astronomy sensors 138 [Wood11]. 140 Store-and-forward delivery relies on reliable hop-by-hop transfers of 141 files, removing the need for the final receiver to talk to the 142 original sender across long delays and allowing for the possibility 143 that an end-to-end path may never exist between sender and receiver 144 at any given time. Use of store-and-forward hop-by-hop delivery is 145 typical of scenarios in space exploration for both near-Earth and 146 deep-space missions, and useful for other scenarios, such as 147 underwater networking, ad-hoc sensor networks, and some message- 148 ferrying relay scenarios. Saratoga is intended to be useful for 149 relaying data in these scenarios, and can optionally also be used to 150 carry the Bundle Protocol "bundles" that is proposed for use in Delay 151 and Disruption-Tolerant Networking (DTN) by the IRTF DTN Research 152 Group [RFC5050]. This has been tested from orbit using the UK-DMC 153 satellite [Ivancic10]. How Saratoga can optionally function as a 154 "bundle convergence layer" alongside a DTN bundle agent is specified 155 in a companion document [I-D.wood-dtnrg-saratoga]. 157 High link utilization is important during periods of limited 158 connectivity. Given that Saratoga was originally developed for 159 scheduled peer-to-peer communications over dedicated links in private 160 networks, where each application has the entire link for the duration 161 of its transfer, early Saratoga implementations deliberately lack any 162 form of congestion control and send at line rate to maximise 163 throughput and link utilisation. Newer implementations may perform 164 TCP-Friendly Rate Control (TFRC) [RFC5348] or other congestion 165 control mechanisms such as LEDBAT [I-D.ietf-ledbat-congestion], if 166 appropriate for the environment, and where simultaneous sharing of 167 capacity with other traffic and applications is required. Sender- 168 side TFRC for Saratoga has been shown to be possible without 169 modifications to this protocol specification [Shahriar11]. 171 Saratoga contains a Selective Negative Acknowledgement (SNACK) 172 'holestofill' mechanism to provide reliable retransmission of data. 173 This is intended to correct losses of corrupted link-layer frames due 174 to channel noise over a space link. Packet losses in the DMC are due 175 to corruption introducing non-recoverable errors in the frame. The 176 DMC design uses point-to-point links and scheduling of applications 177 in order, so that the link is dedicated to one application transfer 178 at a time, meaning that packet loss cannot be due to congestion when 179 applications compete for link capacity simultaneously. In other 180 wireless environments that may be shared by many nodes and 181 applications, allocation of channel resources to nodes becomes a MAC- 182 layer function. Forward Error Coding (FEC) to get the most reliable 183 transmission through a channel is best left near the physical layer 184 so that it can be tailored for the channel. Use of FEC complements 185 Saratoga's transport-level negative-acknowledgement approach to 186 provide a reliable ARQ mechanism [RFC3366]. 188 Saratoga is scalable in that it is capable of efficiently 189 transferring small or large files, by choosing a width of file offset 190 descriptor appropriate for the filesize, and advertising accepted 191 offset descriptor sizes. 16-bit, 32-bit, 64-bit and 128-bit 192 descriptors can be selected, for maximum file sizes of 64KiB-1, 193 4GiB-1, 2^64-1 and 2^128-1 octets. Earth imaging files currently 194 transferred by Saratoga are mostly up to a few gigabytes in size. 195 Some implementations do transfer more than 4 GiB in size, and so 196 require offset descriptors larger than 32 bits. We expect that a 197 128-bit descriptor will satisfy all future needs, but we expect 198 current implementations to only support up to 32-bit or 64-bit 199 descriptors, depending on their application needs. The 16-bit 200 descriptor is useful for small messages, including messages from 201 8-bit devices, and is always supported. The 128-bit descriptor is 202 useful for moving very large files stored on a 128-bit filesystem, 203 such as on OpenSolaris ZFS. 205 As a UDP-based protocol, Saratoga can be used with either IPv4 or 206 IPv6. Compatibility between Saratoga and the wide variety of links 207 that can already carry IP traffic is assured. 209 Saratoga was originally implemented as outlined in [Jackson04], but 210 the specification given here differs substantially, as we have added 211 a number of features while cleaning up the initial Saratoga 212 specification. The original Saratoga code uses a version number of 213 0, while code that implements this version of the protocol advertises 214 a version number of 1. Further discussion of the history and 215 development of Saratoga is given in [Wood07b]. 217 This document contains an overview of the transfer process and 218 transactions using Saratoga in Section 2, followed by a formal 219 definition of the packet types used by Saratoga in Section 4, and the 220 details of the various protocol mechanisms in Section 6. 222 Here, Saratoga transaction types are labelled with underscores around 223 lowercase names (such as a "_get_" transaction), while Saratoga 224 packet types are labelled in all capitals (such as a "REQUEST" 225 packet) in order to distinguish between the two. 227 The remainder of this specification uses 'file' as a shorthand for 228 'binary object', which may be a DTN bundle, or other type of data. 229 This specification uses 'file' when also discussing streaming of data 230 of indeterminate length. 232 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 233 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 234 document are to be interpreted as described in RFC 2119. [RFC2119] 236 2. Overview of Saratoga File Transfer 238 Saratoga is a peer-to-peer protocol in the sense that multiple files 239 may be transferred in both directions simultaneously between two 240 communicating Saratoga peers, and there is not intended to be a 241 strict client-to-server relationship. 243 Saratoga nodes can act as simple file servers. Saratoga supports 244 several types of operations on files including "pull" downloads, 245 "push" uploads, directory listing, and deletion requests. Each 246 operation is handled as a distinct "transaction" between the peers. 248 Saratoga nodes MAY advertise their presence, capabilities, and 249 desires by sending BEACON packets. These BEACONs are sent to either 250 a reserved, unforwardable, multicast address when using IPv4, or a 251 link-local all-Saratoga-peers multicast address when using IPv6. A 252 BEACON might also be unicast to another known node as a sort of 253 "keepalive". Saratoga nodes may dynamically discover other Saratoga 254 nodes, either through listening for BEACONs, through pre- 255 configuration, via some other trigger from a user, lower-layer 256 protocol, or another process. The BEACON is useful in many 257 situations, such as ad-hoc networking, as a simple, explicit, 258 confirmation that another node is present; a BEACON is not required 259 in order to begin a Saratoga transaction. BEACONs have been used by 260 the DMC satellites to indicate to ground stations that a link has 261 become functional, a solid-state data recorder is online, and the 262 software is ready to transfer any requested files. 264 A Saratoga transaction begins with either a _get_, _put_, _getdir_, 265 or _delete_ transaction REQUEST packet corresponding to a desired 266 download, upload, directory listing, or deletion operation. _put_ 267 transactions may instead begin directly with METADATA and DATA, 268 without an initial REQUEST/OKAY STATUS exchange; these are known as 269 'blind puts'. The most common envisioned transaction is the _get_, 270 which begins with a single Saratoga REQUEST packet sent from the peer 271 wishing to receive the file, to the peer who currently has the file. 272 If the transaction is rejected, then a brief STATUS packet that 273 conveys rejection is generated. If the file-serving peer accepts the 274 transaction, an OKAY STATUS can be optional; the peer can immediately 275 generate and send a more useful descriptive METADATA packet, along 276 with some number of DATA packets constituting the requested file. 278 These DATA packets are finished by (and can intermittently include) a 279 DATA packet with a flag bit set that demands the file-receiver send a 280 reception report in the form of a STATUS packet. The STATUS packet 281 can include 'holestofill' Selective Negative Acknowledgement (SNACK) 282 information listing spans of octets within the file that have not yet 283 been received, as well as whether or not the METADATA packet was 284 received. Based on the information in this STATUS packet, the file- 285 sender can begin a cycle of selective retransmissions of missing DATA 286 packets, until it sees a STATUS packet that acknowledges total 287 reception of all file data. 289 In the example scenario in Figure 1, a _get_ request is granted. The 290 reliable file delivery experiences loss of a single DATA packet due 291 to channel-induced errors. 293 File-Receiver File-Sender 295 GET REQUEST ---------------------> 296 (indicates acceptance) <------- STATUS 297 <------- METADATA 298 <---------------------- DATA #1 299 STATUS -----------------> (voluntarily sent at start) 300 (lost) <------ DATA #2 301 <---------------------- DATA #3 (bit set 302 requesting STATUS) 303 STATUS -----------------> 304 (indicating that range in DATA #2 was lost) 305 <----------------------- DATA #2 (bit set 306 requesting STATUS) 307 STATUS -----------------> 308 (complete file and METADATA received) 310 Figure 1: Example _get_ transaction sequence 312 A _getdir_ request proceeds similarly, though the DATA packets 313 contain the contents of a directory listing, described later, rather 314 than a given file's bytes. _getdir_ is the only request to apply to 315 directories. A _put_ is similar, although once the OKAY STATUS is 316 received, DATA is sent from the peer that originated the _put_ 317 request. 319 The STATUS and DATA packets are allowed to be sent at any time within 320 the scope of a transaction, in order for the file-sending node to 321 optimize buffer management and transmission order. For example, if 322 the file-receiver already has the first part of a file from a 323 previous disrupted transfer, it may send a STATUS at the beginning of 324 the transaction indicating that it has the first part of the file, 325 and so only needs the last part of the file. Thus, efficient 326 recovery from interrupted sessions between peers becomes possible, 327 similar to ranged FTP and HTTP requests. (Note that METADATA with a 328 checksum is useful to verify that the parts are of the same file and 329 that the file is reassembled correctly.) 331 The Saratoga 'blind _put_' transaction is initiated by the file- 332 sender sending an optional METADATA packet followed by immediate DATA 333 packets, without waiting for a STATUS response. This can be 334 considered an "optimistic" mode of protocol operation, as it assumes 335 the transaction request will be granted. If the sender of a PUT 336 request sees a STATUS packet indicating that the request was 337 declined, it MUST stop sending any DATA packets within that 338 transaction immediately. Since this type of _put_ is open-loop for 339 some period of time, it should not be used in scenarios where 340 congestion is a valid concern; in these cases, the file-sender should 341 wait on its METADATA to be acknowledged by a STATUS before sending 342 DATA packets within the transaction. 344 Figure 2 illustrates the sequence of packets in an example _put_ 345 transaction, beginning directly with METADATA and DATA as in a blind 346 put, where the second DATA packet is lost. Other than the way that 347 it is initiated, the mechanics of data delivery of a blind _put_ 348 transaction are similar to a _get_ transaction. 350 File-Sender File-Receiver 352 METADATA ----------------> 353 DATA #1 ----------------> 354 (transfer accepted) <---------- STATUS 355 DATA #2 ---> (lost) 356 DATA #3 (bit set ------------> 357 requesting STATUS) 358 (DATA #2 lost) <---------- STATUS 359 DATA #2 (bit set ------------> 360 requesting STATUS) 361 (transfer complete) <---------- STATUS 363 Figure 2: Example PUT transaction sequence 365 In deep-space scenarios, the large propagation delays and round-trip 366 times involved discourage use of ping-pong packet exchanges (such as 367 TCP's SYN/ACK) for starting transactions, and unidirectional 368 transfers via these optimistic 'blind _put_s' are desirable. Blind 369 _puts_ are the only mode of transfer suitable for unidirectional 370 links. Senders sending on unidirectional links SHOULD send a copy of 371 the METADATA in advance of DATA packets, and MAY resend METADATA at 372 intervals. 374 The _delete_ transactions are simple single packet requests that 375 trigger a STATUS packet with a status code that indicates whether the 376 file was deleted or not. If the file is not able to be deleted for 377 some reason, this reason can be conveyed in the Status field of the 378 STATUS packet. 380 A _get_ REQUEST packet that does not specify a filename (i.e. the 381 request contains a zero-length File Path field) is specially defined 382 to be a request for any chosen file that the peer wishes to send it. 383 This 'blind _get_' allows a Saratoga peer to request any files that 384 the other Saratoga peer has ready for it, without prior knowledge of 385 the directory listing, and without requiring the ability to examine 386 files or decode remote file names/paths for meaningful information 387 such as final destination. 389 If a file is larger than Saratoga can be expected to transfer during 390 a time-limited contact, there are at least two feasible options: 392 (1) The application can use proactive fragmentation to create 393 multiple smaller-sized files. Saratoga can transfer some number of 394 these smaller files fully during a contact. 396 (2) To avoid file fragmentation, a Saratoga file-receiver can retain 397 a partially-transferred file and request transfer of the unreceived 398 bytes during a later contact. This uses a STATUS packet to make 399 clear how much of the file has been successfully received and where 400 transfer should be resumed from, and relies on use of METADATA to 401 identify the file. On resumption of a transfer, the new METADATA 402 (including file length, file timestamps, and possibly a file 403 checksum) MUST match that of the previous METADATA in order to re- 404 establish the transfer. Otherwise, the file-receiver MUST assume 405 that the file has changed and purge the DATA payload received during 406 previous contacts. 408 Like the BEACON packets, a _put_ or a response to a _get_ MAY be sent 409 to the dedicated IPv4 Saratoga multicast address (allocated to 410 224.0.0.108) or the dedicated IPv6 link-local multicast address 411 (allocated to FF02:0:0:0:0:0:0:6C) for multiple file-receivers on the 412 link to hear. This is at the discretion of the file-sender, if it 413 believes that there is interest from multiple receivers. In-progress 414 DATA transfers MAY also be moved seamlessly from unicast to multicast 415 if the file-sender learns during a transfer, from receipt of further 416 unicast _get_ REQUEST packets, that multiple nodes are interested in 417 the file. The associated METADATA packet is multicast when this 418 transition takes place, and is then repeated periodically while the 419 DATA stream is being sent, to inform newly-arrived listeners about 420 the file being multicast. Acknowledgements MUST NOT be demanded by 421 multicast DATA packets, to prevent ack implosion at the file-sender, 422 and instead status SNACK information is aggregated and sent 423 voluntarily by all file-receivers. File-receivers respond to 424 multicast DATA with multicast STATUS packets. File-receivers SHOULD 425 introduce a short random delay before sending a multicast STATUS 426 packet, to prevent ack implosion after a channel-induced loss, and 427 MUST listen for STATUS packets from others, to avoid duplicating fill 428 requests. The file-sender SHOULD repeat any initial unicast portion 429 of the transfer as multicast last of all, and may repeat and cycle 430 through multicast of the file several times while file-receivers 431 express interest via STATUS or _get_ packets. Once in multicast and 432 with METADATA being repeated periodically, new file-receivers do not 433 need to send individual REQUEST packets. If a transfer has been 434 started using UDP-Lite and new receivers indicate UDP-only 435 capability, multicast transfers MUST switch to using UDP to 436 accommodate them. 438 3. Optional Parts of Saratoga 440 Implementing support for some parts of Saratoga is optional. These 441 parts are grouped into three sections, namely useful capabilities in 442 Saratoga that are likely to be supported by implementations, 443 congestion control that is needed in shared networks and across the 444 public Internet, and functionality requiring other protocols that is 445 less likely to be supported. 447 3.1. Optional but useful functions in Saratoga 449 These are useful capabilities in Saratoga that implementations SHOULD 450 support, but may not, depending on scenarios: 452 - sending and parsing BEACONs. 454 - sending and parsing METADATA. However, sending and receiving 455 METADATA is considered extremely useful, as is strongly recommended. 457 - streaming data, including real-time streaming of content of unknown 458 length. This streaming can be unreliable (without resend requests) 459 or reliable (with resend requests). Session protocols such as http 460 expect reliable streaming, and can be used in delay-tolerant networks 461 [I-D.wood-dtnrg-http-dtn-delivery]. Although Saratoga data delivery 462 is inherently one-way, where a stream of DATA packets elicits a 463 stream of STATUS packets, bidirectional duplex communication can be 464 established by using two Saratoga transfers flowing in opposite 465 directions. 467 - multicast DATA transfers, if judged useful for the environment in 468 which Saratoga is deployed, when multiple receivers are participating 469 and are receiving the same file or stream. 471 - sending and parsing STATUS messages, which are expected for 472 bidirectional communication, but cannot be sent on and are not 473 required for sending over unidirectional links. 475 - sending and responding to packet timestamps in DATA and STATUS 476 packets. These timestamps are useful for streaming and for giving a 477 file-sender an indication of path latency for rate control. There is 478 no need for a file-receiver to understand the format used for these 479 timestamps for it to be able to receive and reflect them. 481 3.2. Optional congestion control 483 Saratoga can be implemented to perform congestion control at the 484 sender, based on feedback from acknowledgement STATUS packets 485 [Shahriar11], or have the sender configured to use simple open-loop 486 rate control to only use a fixed amount of link capacity. Congestion 487 control is expected to be undesirable for Saratoga's use cases and 488 expected environmental conditions, while simple rate control is 489 considered useful. 491 Congestion control MUST be supported if Saratoga is being used across 492 the public Internet, and SHOULD be supported in environments where 493 links are shared by traffic flows. Congestion control MAY NOT be 494 supported across private, single-flow links engineered for 495 performance: Saratoga's primary use case. 497 3.3. Optional functionality requiring other protocols 499 The functionality listed here is useful in rare cases, but requires 500 use of other, optional, protocols. This functionality MAY be 501 supported by Saratoga implementations: 503 - support for working with the Bundle Protocol for Delay-Tolerant 504 Networking. Saratoga can optionally also be used to carry the Bundle 505 Protocol "bundles" that is proposed for use in Delay and Disruption- 506 Tolerant Networking (DTN) by the IRTF DTN Research Group [RFC5050]. 507 The bundle agent acts as an application driving Saratoga. Use of a 508 filesystem is expected. This approach has been tested from orbit 509 using the UK-DMC satellite [Ivancic10]. How Saratoga can optionally 510 function as a "bundle convergence layer" alongside a DTN bundle agent 511 is specified in a companion document [I-D.wood-dtnrg-saratoga]. 513 - transfers permitting some errors in content delivered, using UDP- 514 Lite [RFC3828]. These can be useful for decreasing delivery time 515 over unreliable channels, especially for unidirectional links, or in 516 decreasing computational overhead for the UDP Lite checksum. Error 517 tolerance requires that lower-layer frames permit delivery of 518 unreliable data to be really useful. 520 If a file contains separate parts that require reliable transmission 521 without errors or that can tolerate errors in delivered content, 522 proactive fragmentation can be used to split the file into separate 523 reliable and unreliable files that can be transferred separately, 524 using UDP or UDP-Lite. 526 If parts of a file require reliability but the rest can be sent by 527 unreliable transfer, the file-sender can use its knowledge of the 528 internal file structure and vary DATA packet size so that the 529 reliable parts always start after the offset field and are covered by 530 the UDP-Lite checksum. 532 A file that permits unreliable delivery can be transferred onwards 533 using UDP. If the current sender does not understand the internal 534 file format to be able to decide what parts must be protected with 535 payload checksum coverage, the current sender or receiver does not 536 support UDP-Lite, or the current protocol stack only implements 537 error-free frame delivery below the UDP layer, then the file MAY be 538 delivered using UDP. 540 4. Packet Types 542 Saratoga is defined for use with UDP over either IPv4 or IPv6 543 [RFC0768]. UDP checksums, which are mandatory with IPv6, MUST be 544 used with IPv4. Within either version of IP datagram, a Saratoga 545 packet appears as a typical UDP header followed by an octet 546 indicating how the remainder of the packet is to be interpreted: 548 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 549 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 550 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 551 | UDP source port | UDP destination port | 552 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 553 | UDP length | UDP checksum | 554 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 555 |Ver|Packet Type| other Saratoga fields ... // 556 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// 558 Saratoga data transfers can also be carried out using UDP-Lite 559 [RFC3828]. If Saratoga can be carried over UDP-Lite, the 560 implementation MUST also support UDP. All packet types except DATA 561 MUST be sent using UDP with checksums turned on. For reliable 562 transfers, DATA packets are sent using UDP with checksums turned on. 563 For files where unreliable transfer has been indicated as desired and 564 possible, the sender MAY send DATA packets unreliably over UDP-Lite, 565 where UDP-Lite protects only the Saratoga headers and parts of the 566 file that must be transmitted reliably. 568 The two-bit Saratoga version field ("Ver") identifies the version of 569 the Saratoga protocol that the packet conforms to. The value 01 570 should be used in this field for implementations conforming to the 571 specification in this document, which specifies version 1 of 572 Saratoga. The value 00 was used in earlier implementations, prior to 573 the formal specification and public submission of the protocol 574 design, and is incompatible with version 01 in several respects. 576 The six-bit Saratoga "Packet Type" field indicates how the remainder 577 of the packet is intended to be decoded and processed: 579 +---+----------+----------------------------------------------------+ 580 | # | Type | Use | 581 +---+----------+----------------------------------------------------+ 582 | 0 | BEACON | Beacon packet indicating peer status. | 583 | 1 | REQUEST | Commands peer to start a transfer. | 584 | 2 | METADATA | Carries file transfer metadata. | 585 | 3 | DATA | Carries octets of file data. | 586 | 4 | STATUS | responds to REQUEST or DATA. Can signal list of | 587 | | | unreceived data to sender during a transfer. | 588 +---+----------+----------------------------------------------------+ 590 Several of these packet types include a Flags field, for which only 591 some of the bits have defined meanings and usages in this document. 592 Other, undefined, bits may be reserved for future use. Following the 593 principle of being conservative in what you send and liberal in what 594 you accept, a packet sender MUST set any undefined bits to zero, and 595 a packet recipient MUST NOT rely on these undefined bits being zero 596 on reception. 598 The specific formats for the different types of packets are given in 599 this section. Some packet types contain file offset descriptor 600 fields, which contain unsigned integers. The lengths of the offset 601 descriptors are fixed within a transfer, but vary between file 602 transfers. The size is set for each particular transfer, depending 603 on the choice of offset descriptor width made in the METADATA packet, 604 which in turn depends on the size of file being transferred. 606 In this document, all of the packet structure figures illustrating a 607 packet format assume 32-bit lengths for these offset descriptor 608 fields, and indicate the transfer-dependent length of the fields by 609 using a "(descriptor)" designation within the [field] in all packet 610 diagrams. That is: 612 The example 32-bit descriptors shown in all diagrams here 614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 615 [ (descriptor) ] 616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 618 are suitable for files of up to 4GiB - 1 octets in length, and may be 619 replaced in a file transfer by descriptors using a different length, 620 depending on the size of file to be transferred: 622 16-bit descriptor for short files (MUST be supported) 624 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 625 [ (descriptor) ] 626 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 627 64-bit descriptor for longer files (optional) 629 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 630 [ (descriptor) / 631 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 632 / (descriptor, continued) ] 633 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 635 128-bit descriptor for very long files (optional) 637 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 638 [ (descriptor) / 639 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 640 / (descriptor, continued) / 641 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 642 / (descriptor, continued) / 643 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 644 / (descriptor, continued) ] 645 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 647 For offset descriptors and types of content being transferred, the 648 related flag bits in BEACON and REQUEST indicate capabilities, while 649 in METADATA and DATA those flag bits are used slightly differently, 650 to indicate the content being transferred. 652 Saratoga packets are intended to fit within link MTUs to avoid the 653 inefficiencies and overheads of lower-layer fragmentation. A 654 Saratoga implementation itself does not perform any form of MTU 655 discovery, but is assumed to be configured with knowledge of usable 656 maximum IP MTUs for the link interfaces it uses. 658 4.1. BEACON 660 BEACON packets may be multicast periodically by nodes willing to act 661 as Saratoga peers, or unicast to individual peers to indicate 662 properties for that peer. Some implementations have sent BEACONS 663 every 100 milliseconds, but this rate is arbitrary, and should be 664 chosen to be appropriate for the environment and implementation. 666 The main purpose for sending BEACONs is to announce the presence of 667 the node to potential peers (e.g. satellites, ground stations) to 668 provide automatic service discovery, and also to confirm the activity 669 or presence of the peer. 671 The Endpoint Identifier (EID) in the BEACON serves to uniquely 672 identify the Saratoga peer. Whenever the Saratoga peer begins using 673 a new IP address, it SHOULD issue a BEACON on it and repeat the 674 BEACON periodically, to enable listeners to associate the IP address 675 with the EID and the peer. 677 Format 679 0 1 2 3 680 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 681 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 682 |0 1| Type | Flags | 683 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 684 [[ Available free space (optional) ]] 685 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 686 | Endpoint identifier... // 687 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// 689 where 691 +------------+------------------------------------------------------+ 692 | Field | Description | 693 +------------+------------------------------------------------------+ 694 | Type | 0 | 695 | Flags | convey whether or not the peer is ready to | 696 | | send/receive, what the maximum supported file size | 697 | | range and descriptor is, and whether and how free | 698 | | space is indicated. | 699 | Available | This optional field can be used to indicate the | 700 | free space | current free space available for storage. | 701 | Endpoint | This can be used to uniquely identify the sending | 702 | identifier | Saratoga peer, or the administrative node that the | 703 | | BEACON-sender is associated with. If Saratoga is | 704 | | being used with a bundle agent, a bundle endpoint ID | 705 | | (EID) can be used here. | 706 +------------+------------------------------------------------------+ 708 The Flags field is used to provide some additional information about 709 the peer. The first two octets of the Flags field is currently in 710 use. The later octet is for future use, and MUST be set to zero. 712 The two highest-order bits (bits 8 and 9 above) indicate the maximum 713 supported file size parameters that the peer's Saratoga 714 implementation permits. Other Saratoga packet types contain 715 variable-length fields that convey file sizes or offsets into a file 716 -- the file offset descriptors. These descriptors may be 16-bit, 32- 717 bit, 64-bit, or 128-bit in length, depending on the size of the file 718 being transferred and/or the integer types supported by the sending 719 peer. The indicated bounds for the possible values of these bits are 720 summarized below: 722 +-------+-------+-------------------------+-------------------+ 723 | Bit 8 | Bit 9 | Supported Field Sizes | Maximum File Size | 724 +-------+-------+-------------------------+-------------------+ 725 | 0 | 0 | 16 bits | 2^16 - 1 octets. | 726 | 0 | 1 | 16 or 32 bits | 2^32 - 1 octets. | 727 | 1 | 0 | 16, 32, or 64 bits | 2^64 - 1 octets. | 728 | 1 | 1 | 16, 32, 64, or 128 bits | 2^128 - 1 octets. | 729 +-------+-------+-------------------------+-------------------+ 731 If a Saratoga peer advertises it is capable of receiving a certain 732 size of file, then it MUST also be capable of receiving files sent 733 using smaller descriptor values. This avoids overhead on small 734 files, while increasing interoperability between peers. 736 It is likely when sending unbounded streams that a larger offset 737 descriptor field size will be preferred to minimise problems with 738 offset sequence numbers wrapping. Protecting against sequence number 739 wrapping is discussed in the STATUS section. 741 +-----+-------+-----------------------------------------------------+ 742 | Bit | Value | Meaning | 743 +-----+-------+-----------------------------------------------------+ 744 | 10 | 0 | not able to pass bundles to a local bundle agent; | 745 | | | handles files only. | 746 | 10 | 1 | handles files, but can also pass marked bundles to | 747 | | | a local bundle agent. | 748 +-----+-------+-----------------------------------------------------+ 750 Bit 10 is reserved for DTN bundle agent use, indicating whether the 751 sender is capable of handling bundles via a local bundle agent. This 752 is described in [I-D.wood-dtnrg-saratoga]. 754 +-----+-------+--------------------------------------+ 755 | Bit | Value | Meaning | 756 +-----+-------+--------------------------------------+ 757 | 11 | 0 | not capable of supporting streaming. | 758 | 11 | 1 | capable of supporting streaming. | 759 +-----+-------+--------------------------------------+ 761 Bit 11 is used to indicate whether the sender is capable of sending 762 and receiving continuous streams. 764 +--------+--------+------------------------------------------------+ 765 | Bit 12 | Bit 13 | Capability and willingness to send files | 766 +--------+--------+------------------------------------------------+ 767 | 0 | 0 | cannot send files at all. | 768 | 0 | 1 | invalid. | 769 | 1 | 0 | capable of sending, but not willing right now. | 770 | 1 | 1 | capable of and willing to send files. | 771 +--------+--------+------------------------------------------------+ 773 +-------+-------+---------------------------------------------------+ 774 | Bit | Bit | Capability and willingness to receive files | 775 | 14 | 15 | | 776 +-------+-------+---------------------------------------------------+ 777 | 0 | 0 | cannot receive files at all. | 778 | 0 | 1 | invalid. | 779 | 1 | 0 | capable of receiving, but unwilling. Will reject | 780 | | | METADATA or DATA packets. | 781 | 1 | 1 | capable of and willing to receive files. | 782 +-------+-------+---------------------------------------------------+ 784 Also in the Flags field, bits 12 and 14 act as capability bits, while 785 bits 13 and 15 augment those flags with bits indicating current 786 willingness to use the capability. 788 Bits 12 and 13 deal with sending, while bits 14 and 15 deal with 789 receiving. If bit 12 is set, then the peer has the capability to 790 send files. If bit 14 is set, then the peer has the capability to 791 receive files. Bits 13 and 15 indicate willingness to send and 792 receive files, respectively. 794 A peer that is able to act as a file-sender MUST set the capability 795 bit 12 in all BEACONs that it sends, regardless of whether it is 796 willing to send any particular files to a particular peer at a 797 particular time. Bit 13 indicates the current presence of data to 798 send and a willingness to send it in general, in order to augment the 799 capability advertised by bit 12. 801 If bit 14 is set, then the peer is capable of acting as a receiver, 802 although it still might not currently be ready or willing to receive 803 files (for instance, it may be low on free storage). This bit MUST 804 be set in any BEACON packets sent by nodes capable of acting as file- 805 receivers. Bit 15 augments this by expresses a current general 806 willingness to receive and accept files. 808 +-----+-------+-----------------------------------------------------+ 809 | Bit | Value | Meaning | 810 +-----+-------+-----------------------------------------------------+ 811 | 16 | 0 | supports DATA transfers over UDP only. | 812 | 16 | 1 | supports DATA transfers over both UDP and UDP-Lite. | 813 +-----+-------+-----------------------------------------------------+ 815 Bit 16 is used to indicate whether the sender is capable of sending 816 and receiving unreliable transfers via UDP-Lite. 818 +-----+-------+-----------------------------------------------------+ 819 | Bit | Value | Meaning | 820 +-----+-------+-----------------------------------------------------+ 821 | 17 | 0 | available free space is not advertised in this | 822 | | | BEACON. | 823 | 17 | 1 | available free space is advertised in this BEACON. | 824 +-----+-------+-----------------------------------------------------+ 826 Bit 17 is used to indicate whether the sender is indicating how much 827 free space is indicated in an optional field in this BEACON packet. 828 If bit 17 is set, then bits 18 and 19 are used to indicate the size 829 in bits of the optional free-space-size field. If bit 17 is not set, 830 then bits 18 and 19 are zero. 832 +--------+--------+--------------------------+ 833 | Bit 18 | Bit 19 | Size of free space field | 834 +--------+--------+--------------------------+ 835 | 0 | 0 | 16 bits. | 836 | 0 | 1 | 32 bits. | 837 | 1 | 0 | 64 bits. | 838 | 1 | 1 | 128 bits. | 839 +--------+--------+--------------------------+ 841 The free space field size can vary as indicated by a varying-size 842 field indicated in bits 18 and 19 of the flags field. Unlike other 843 offset descriptor use where the value in the descriptor indicates a 844 byte or octet position for retransmission, or gives a file size in 845 bytes, this particular field indicates the available free space in 846 KILOBYTES (KiB, multiples of 1024 octets), rather than octets. 847 (Kilobytes are used as storage can be in local memory.) Available 848 free space is rounded down to the nearest KiB, so advertising zero 849 means that less than 1KiB is free and available. Advertising the 850 maximum size possible in the field means that more free space than 851 that is available. While this field is intended to be scalable, it 852 is expected that 32 bits (up to 4TiB) will be most common in use. 854 A BEACON unicast to an individual peer MAY choose to indicate the 855 free space available for use by that particular peer, and MAY 856 indicate capabilities only available to that particular peer, 857 overriding or supplementing the properties advertised to all local 858 peers by multicast BEACONs. 860 Any type of host identifier can be used in the endpoint identifier 861 field, as long as it is a reasonably unique string within the range 862 of operational deployment. This field encompasses the remainder of 863 the packet, and might contain non-UTF-8 and/or null characters. 865 4.2. REQUEST 867 A REQUEST packet is an explicit command to perform either a _get_, 868 _getdir_, or _delete_ transaction. 870 Format 872 0 1 2 3 873 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 874 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 875 |0 1| Type | Flags | Request Type | 876 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 877 | Id | 878 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 879 | variable-length File Path ... / 880 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 881 / / 882 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 883 / | null byte | / 884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 885 / variable-length Authentication Field (optional) | 886 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 888 where 890 +---------+---------------------------------------------------------+ 891 | Field | Description | 892 +---------+---------------------------------------------------------+ 893 | Type | 1 | 894 | Flags | provide additional information about the requested | 895 | | file/operation; see table below for definition. | 896 | Request | identifies the type of request being made; see table | 897 | Type | further below for request values. | 898 | Id | uniquely identifies the transaction between two peers. | 899 | File | the path of the requested file/directory following the | 900 | Path | rules described below. | 901 +---------+---------------------------------------------------------+ 902 The Id that is used during transactions serves to uniquely associate 903 a given packet with a particular transaction. This enables multiple 904 simultaneous data transfer or request/status transactions between two 905 peers, with each peer deciding how to multiplex and prioritise the 906 parallel flows it sends. The Id for a transaction is selected by the 907 initiator so as to not conflict with any other in-progress or recent 908 transactions with the same host. This Id should be unique and 909 generated using properties of the file, which will remain constant 910 across a host reboot. The 3-tuple of both host identifiers and a 911 carefully-generated transaction Id field can be used to uniquely 912 index a particular transaction's state. 914 In the Flags field, the bits labelled 8 and 9 in the figure above 915 indicate the maximum supported file length fields that the peer can 916 handle, and are interpreted exactly as the bits 8 and 9 in the BEACON 917 packet described above. Bits 12 and 13, and 14 and 15, indicate 918 capability and willingness to send and receive files, as described 919 above. Making a _get_ request would require that the requester is 920 capable and willing to receive files. The remaining defined 921 individual bits are as summarised as follows: 923 +-----+-------+-----------------------------------------------------+ 924 | Bit | Value | Meaning | 925 +-----+-------+-----------------------------------------------------+ 926 | 10 | 0 | The requester cannot handle bundles locally. | 927 | 10 | 1 | The requester can handle bundles. | 928 | 11 | 0 | The requester cannot receive streams. | 929 | 11 | 1 | The requester is also able to receive streams. | 930 | 16 | 0 | The requester is able to receive DATA over UDP | 931 | | | only. | 932 | 16 | 1 | The requester is also able to receive DATA over | 933 | | | UDP-Lite. | 934 +-----+-------+-----------------------------------------------------+ 936 The Request Type field is an octet that contains a value indicated 937 the type of request being made. Possible values are: 939 +-------+-----------------------------------------------------------+ 940 | Value | Meaning | 941 +-------+-----------------------------------------------------------+ 942 | 0 | No action is to be taken; similar to a BEACON. | 943 | 1 | A _get_ transaction is requested. The File Path field | 944 | | holds the name of the file to be sent. | 945 | 2 | A _put_ transaction is requested. The File Path field | 946 | | suggests the name of the file that will be delivered only | 947 | | after an OK STATUS is received from the file receiver. | 948 | 3 | A _get_ transaction is requested, and once received | 949 | | successfully, the original copy should be deleted. The | 950 | | File Path field holds the name of the file to be sent. | 951 | | (This get+delete is known as a 'take'.) | 952 | 4 | A _put_ transaction is requested, and once sent | 953 | | successfully, the original copy will be deleted. The | 954 | | File Path field holds the name of the file to be sent. | 955 | | (This put+delete is known as a 'give'.) | 956 | 5 | A _delete_ transaction is requested, and the File Path | 957 | | field specifies the name of the file or directory to be | 958 | | deleted. | 959 | 6 | A _getdir_ transaction is requested. The File Path field | 960 | | holds the name of the directory to be examined. | 961 +-------+-----------------------------------------------------------+ 963 The File Path portion of a _get_ packet is a null-terminated UTF-8 964 encoded string [RFC3629] that represents the path and base file name 965 on the file-sender of the file (or directory) that the file-receiver 966 wishes to perform the _get_, _getdir_, or _delete_ operation on. 967 Implementations SHOULD only send as many octets of File Path as are 968 needed for carrying this string, although some implementations MAY 969 choose to send a fixed-size File Path field in all REQUEST packets 970 that is filled with null octets after the last UTF-8 encoded octet of 971 the path. A maximum of 1024 octets for this field, and for the File 972 Path fields in other Saratoga packet types, is used to limit the 973 total packet size to within a single IPv6 minimum MTU (minus some 974 padding for network layer headers), and thus avoid the need for 975 fragmentation. The 1024-octet maximum applies after UTF-8 encoding 976 and null termination. 978 As in the standard Internet File Transfer Protocol (FTP) [RFC0959], 979 for path separators, Saratoga allows the local naming convention on 980 the peers to be used. There are security implications to processing 981 these strings without some intelligent filtering and checking on the 982 filesystem items they refer to, as discussed in the Security 983 Considerations section later within this document. 985 If the File Path field is empty, i.e. is a null-terminated zero- 986 length string one octet long, then this indicates that the file- 987 receiver is ready to receive any file that the file-sender would like 988 to send it, rather than requesting a particular file. This allows 989 the file-sender to determine the order and selection of files that it 990 would like to forward to the receiver in more of a "push" manner. Of 991 course, file retrieval could also follow a "pull" manner, with the 992 file-receiving host requesting specific files from the file-sender. 993 This may be desirable at times if the file-receiver is low on storage 994 space, or other resources. The file-receiver could also use the 995 Saratoga _getdir_ transaction results in order to select small files, 996 or make other optimizations, such as using its local knowledge of 997 contact times to pick files of a size likely to be able to be 998 delivered completely. File transfer through pushing sender-selected 999 files implements delivery prioritization decisions made solely at the 1000 Saratoga file-sending node. File transfer through pulling specific 1001 receiver-selected files implements prioritization involving more 1002 participation from the Saratoga file-receiver. This is how Saratoga 1003 implements Quality of Service (QoS). 1005 The null-terminated File Path string MAY be followed by an optional 1006 Authentication Field that can be used to validate the REQUEST packet. 1007 Any value in the Authentication Field is the result of a computation 1008 of packet contents that SHOULD include, at a minimum, source and 1009 destination IP addresses and port numbers and packet length in a 1010 'pseudo-header', as well as the content of all Saratoga fields from 1011 Version to File Path, excluding the predictable null-termination 1012 octet. This Authentication Field can be used to allow the REQUEST 1013 receiver to discriminate between other peers, and permit and deny 1014 various REQUEST actions as appropriate. The format of this field is 1015 unspecified for local use. 1017 Combined get+delete (take) and put+delete (give) requests should only 1018 have the delete carried out once the deleting peer is certain that 1019 the file-receiver has a good copy of the file. This may require the 1020 file receiver to verify checksums before sending a final STATUS 1021 message acknowledging successful delivery of the final DATA segment, 1022 or aborting the transfer if the checksum fails. If the transfer 1023 fails and an error STATUS is sent for any reason, the file should not 1024 be deleted. 1026 REQUEST packets may be sent multicast, to learn about all listening 1027 nodes. A multicast _get_ request for a file that elicits multiple 1028 METADATA or DATA responses should be followed by unicast STATUS 1029 packets with status errors cancelling all but one of the proposed 1030 transfers. File timestamps in the Directory Entry can be used to 1031 select the most recent version of an offered file, and the host to 1032 fetch it from. 1034 If the receiver already has the file at the expected file path and is 1035 requesting an update to that file, REQUEST can be sent after a 1036 METADATA advertising that file, to allow the sender to determine 1037 whether a replacement for the file should be sent. 1039 Delete requests are ignored for files currently being transferred. 1041 4.3. METADATA 1043 METADATA packets are sent as part of a data transfer transaction 1044 (_get_, _getfile_, and _put_). A METADATA packet says how large the 1045 file is and what its name is, as well as what size of file offset 1046 descriptor is chosen for the session. METADATA packets are optional. 1047 They are normally sent at the start of a DATA transfer, but may be 1048 repeated if requested. 1050 Format 1052 0 1 2 3 1053 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 1054 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1055 |0 1| Type | Flags |Sumleng|Sumtype| 1056 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1057 | Id | 1058 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1059 | / 1060 / / 1061 / example error-detection checksum (128-bit MD5 shown) / 1062 / / 1063 / | 1064 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1065 | / 1066 / single Directory Entry describing file / 1067 / (variable length) / 1068 / // 1069 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-// 1071 where 1073 +-----------+-------------------------------------------------------+ 1074 | Field | Description | 1075 +-----------+-------------------------------------------------------+ 1076 | Type | 2 | 1077 | Flags | indicate additional boolean metadata about a file. | 1078 | Sumleng | indicates the length of a checksum, as a multiple of | 1079 | | 32 bits. | 1080 | Sumtype | indicates whether a checksum is present after the Id, | 1081 | | and what type it is. | 1082 | Id | identifies the transaction that this packet | 1083 | | describes. | 1084 | Checksum | an example included checksum covering file contents. | 1085 | Directory | describes file system information about the file, | 1086 | Entry | including file length, file timestamps, etc.; the | 1087 | | format is specified in Section 5. | 1088 +-----------+-------------------------------------------------------+ 1089 The first octet of the Flags field is currently specified for use. 1090 The later two octets are reserved for future use, and MUST be set to 1091 zero. 1093 In the Flags field, the bits labelled 8 and 9 in the figure above 1094 indicate the exact size of the offset descriptor fields used in this 1095 particular packet and are interpreted exactly as the bits 8 and 9 in 1096 the BEACON packet described above. The value of these bits 1097 determines the size of the File Length field in the current packet, 1098 as well as indicating the size of the offset fields used in DATA and 1099 STATUS packets within the session that will follow this packet. 1101 +--------+--------+-------------------------------------------------+ 1102 | Bit 10 | Bit 11 | Type of transfer | 1103 +--------+--------+-------------------------------------------------+ 1104 | 0 | 0 | a file is being sent. | 1105 | 0 | 1 | the file being sent should be interpreted as a | 1106 | | | directory record. | 1107 | 1 | 0 | a bundle is being sent. | 1108 | 1 | 1 | an indefinite-length stream is being sent. | 1109 +--------+--------+-------------------------------------------------+ 1111 Also inside the Flags field, bits 10 and 11 indicate what is being 1112 transferred - a file, special file that contains directory records, 1113 bundle, or stream. The value 01 indicates that the METADATA and DATA 1114 packets are being generated in response to a _getdir_ REQUEST, and 1115 that the assembled DATA contents should be interpreted as a sequence 1116 of Directory Records, as defined in Section 5. 1118 +-----+-------+-----------------------------------------------------+ 1119 | Bit | Value | Meaning | 1120 +-----+-------+-----------------------------------------------------+ 1121 | 12 | 0 | This transfer is in progress. | 1122 | 12 | 1 | This transfer is no longer in progress, and has | 1123 | | | been terminated. | 1124 +-----+-------+-----------------------------------------------------+ 1126 Bit 12 indicates whether the transfer is in progress, or has been 1127 terminated by the sender. It is normally set to 1 only when METADATA 1128 is resent to indicate that a stream transfer has been ended. 1130 +--------+----------------------------------------------------------+ 1131 | Bit 13 | Use | 1132 +--------+----------------------------------------------------------+ 1133 | 0 | This file's content MUST be delivered reliably without | 1134 | | errors using UDP. | 1135 | 1 | This file's content MAY be delivered unreliably, or | 1136 | | partly unreliably, where errors are tolerated, using | 1137 | | UDP-Lite. | 1138 +--------+----------------------------------------------------------+ 1140 Bit 13 indicates whether the file must be sent reliably or can be 1141 sent at least partly unreliably, using UDP-Lite. This flag SHOULD 1142 only be set if the originator of the file knows that at least some of 1143 the file content is suitable for sending unreliably and is robust to 1144 errors. This flag reflects a property of the file itself. This flag 1145 may still be set if the immediate file-receiver is only capable of 1146 UDP delivery, on the assumption that this preference will be 1147 preserved for later transfers where UDP-Lite transfers may be taken 1148 advantage of by senders with knowledge of the internal file 1149 structure. The file-sender may know that the receiver is capable of 1150 handling UDP-Lite, either from a _get_ REQUEST, from exchange of 1151 BEACONs, or a-priori. 1153 The high four bits of the Flags field, bits 28-31, are used to 1154 indicate if an error-detection checksum has been included in the 1155 METADATA for the file to be transferred. Here, bits 0000 indicate 1156 that no checksum is present, with the implicit assumption that the 1157 application will do its own end-to-end check. Other values indicate 1158 the type of checksum to use. The choice of checksum depends on the 1159 available computing power and the length of the file to be 1160 checksummed. Longer files require stronger checksums to ensure 1161 error-free delivery. The checksum of the file to be transferred is 1162 carried as shown, with a fixed-length field before the varying-length 1163 File Length and File Name information fields. 1165 Assigned values for the checksum type field are: 1167 +-----------+-------------------------------------------------------+ 1168 | Value | Use | 1169 | (0-15) | | 1170 +-----------+-------------------------------------------------------+ 1171 | 0 | No checksum is provided. | 1172 | 1 | 32-bit CRC32 checksum, suitable for small files. | 1173 | 2 | 128-bit MD5 checksum, suitable for larger files. | 1174 | 3 | 160-bit SHA-1 checksum, suitable for larger files but | 1175 | | slower to process than MD5. | 1176 +-----------+-------------------------------------------------------+ 1178 The length of the checksum cannot be inferred from the checksum type 1179 field, particularly for unknown checksum types. The next-highest 1180 four bits of the 32-bit word holding the Flags, bits 24-27, indicate 1181 the length of the checksum bit field, as a multiple of 32 bits. 1183 +----------------------+--------------------------------------+ 1184 | Example Value (0-15) | Use | 1185 +----------------------+--------------------------------------+ 1186 | 0 | No checksum is provided. | 1187 | 1 | 32-bit checksum field, e.g. CRC32. | 1188 | 4 | 128-bit checksum field, e.g. MD5. | 1189 | 5 | 160-bit checksum field, e.g. SHA-1. | 1190 +----------------------+--------------------------------------+ 1192 For a 32-bit CRC, the length field holds 1 and the type field holds 1193 1. For MD5, the length field holds 4 and the type field holds 2. 1194 For SHA-1, the length field holds 5 and the type field holds 3. 1196 It is expected that higher values will be allocated to new and 1197 stronger checksums able to better protect larger files. These 1198 checksums can be expected to be longer, with larger checksum length 1199 fields. 1201 A checksum SHOULD be included for files being transferred. The 1202 checksum SHOULD be as strong as possible. Streaming of an 1203 indefinite-length stream MUST set the checksum type field to zero. 1205 It is expected that a minimum of the MD5 checksum will be used, 1206 unless the Saratoga implementation is used exclusively for small 1207 transfers at the low end of the 16-bit file descriptor range, such as 1208 on low-performing hardware, where the weaker CRC-32c checksum can 1209 suffice. 1211 The CRC32 checksum is computed as described for the CRC-32c algorithm 1212 given in [RFC3309]. 1214 The MD5 Sum field is generated via the MD5 algorithm [RFC1321], 1215 computed over the entire contents of the file being transferred. The 1216 file-receiver can compute the MD5 result over the reassembled 1217 Saratoga DATA packet contents, and compare this to the METADATA's MD5 1218 Sum field in order to gain confidence that there were no undetected 1219 protocol errors or UDP checksum weaknesses encountered during the 1220 transfer. Although MD5 is known to be less than optimal for security 1221 uses, it remains excellent for non-security use in error detection 1222 (as is done here in Saratoga), and has better performance 1223 implications than cryptographically-stronger alternatives given the 1224 limited available processing of many use cases [RFC6151]. 1226 Checksums may be privately keyed for local use, to allow transmission 1227 of authenticated or encrypted files delivered in DATA packets. This 1228 has limitations, discussed further in Section 8 at end. 1230 Use of the checksum to ensure that a file has been correctly relayed 1231 to the receiving node is important. A provided checksum MUST be 1232 checked against the received data file. If checksum verification 1233 fails, either due to corruption or due to the receiving node not 1234 having the right key for a keyed checksum), the file MUST be 1235 discarded. If the file is to be relayed onwards later to another 1236 Saratoga peer, the metadata, including the checksum, MUST be retained 1237 with the file and SHOULD be retransmitted onwards unchanged with the 1238 file for end-to-end coverage. If it is necessary to recompute the 1239 checksum or encrypted data for the new peer, either because a 1240 different key is in use or the existing checksum algorithm is not 1241 supported, the new checksum MUST be computed before the old checksum 1242 is verified, to ensure overlapping checksum coverage and detect 1243 errors introduced in file storage. 1245 METADATA can be used as an indication to update copies of files. If 1246 the METADATA is in response to a _get_ REQUEST including a file 1247 record, and the record information for the held file matches what the 1248 requester already has, as has been indicated by a previously-received 1249 METADATA advertisement from the requester, then only the METADATA is 1250 sent repeating this information and verifying that the file is up to 1251 date. If the record information does not match and a newer file can 1252 be supplied, the METADATA begins a transfer with following DATA 1253 packets to update the file. 1255 4.4. DATA 1257 A series of DATA packets form the main part of a data transfer 1258 transaction (_get_, _put_, or _getdir_). The payloads constitute the 1259 actual file data being transferred. 1261 Format 1263 0 1 2 3 1264 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 1265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1266 |0 1| Type | Flags | 1267 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1268 | Id | 1269 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1270 | / 1271 / Timestamp/nonce information (optional) / 1272 / / 1273 / | 1274 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1275 [ Offset (descriptor) ] 1276 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1278 where 1279 +-----------------+-------------------------------------------------+ 1280 | Field | Description | 1281 +-----------------+-------------------------------------------------+ 1282 | Type | 3 | 1283 | Flags 8 and 9 | bit 8 and 9 specify the size of offset | 1284 | | descriptor, as elsewhere. | 1285 | Flag 10 | bit 10, with bit 11, indicates whether a file, | 1286 | | bundle, stream or directory entry is being | 1287 | | carried. This bit will normally be zero for | 1288 | | files. | 1289 | Flag 11 | bit 11 is used with bit 10. Normally this bit | 1290 | | will be zero for files. | 1291 | Flag 12 | bit 12 indicates that an optional timestamp or | 1292 | | nonce is included in the DATA header before the | 1293 | | offset descriptor. | 1294 | Flag 15 | bit 15 requests an immediate STATUS ack to be | 1295 | | generated in response to receiving this packet. | 1296 | Id | identifies the transaction to which this packet | 1297 | | belongs. | 1298 | Timestamp/nonce | is an optional 128-bit field providing timing | 1299 | | or identification information unique to this | 1300 | | packet. See Appendix A for details. | 1301 | Offset | the offset in octets to the location where the | 1302 | | first byte of this packet's payload is to be | 1303 | | written. | 1304 +-----------------+-------------------------------------------------+ 1306 The DATA packet has a minimum size of ten octets, using sixteen-bit 1307 descriptors and no timestamps. 1309 DATA packets are normally checked by the UDP checksum to prevent 1310 errors in either the header or the payload content. However, for 1311 transfers that can tolerate content errors, DATA packets MAY be sent 1312 using UDP-Lite. If UDP-Lite is used, the file-sender must know that 1313 the file-receiver is capable of handling UDP-Lite, and the file 1314 contents to be transferred should be resilient to errors. The UDP- 1315 Lite checksum MUST protect the Saratoga headers, up to and including 1316 the offset descriptor, and MAY protect more of each packet's payload, 1317 depending on the file-sender's knowledge of the internal structure of 1318 the file and the file's reliability requirements. 1320 Flag bits 8 and 9 are set to indicate the size of the offset 1321 descriptor as described for BEACON and METADATA packets, so that each 1322 DATA packet is self-describing. This allows the DATA packet to be 1323 used to construct a file even when the initial METADATA is lost and 1324 must be resent. The flag values for bits 8, 9, 10 and 11 MUST be the 1325 same as indicated in the initial METADATA packet. 1327 +--------+--------+-------------------------------------------------+ 1328 | Bit 10 | Bit 11 | Type of transfer | 1329 +--------+--------+-------------------------------------------------+ 1330 | 0 | 0 | a file is being sent. | 1331 | 0 | 1 | the file being sent should be interpreted as a | 1332 | | | directory record. | 1333 | 1 | 0 | a bundle is being sent. | 1334 | 1 | 1 | an indefinite-length stream is being sent. | 1335 +--------+--------+-------------------------------------------------+ 1337 Also inside the Flags field, bits 10 and 11 indicate what is being 1338 transferred - a file, special file that contains directory records, 1339 bundle, or stream. The value 01 indicates that the METADATA and DATA 1340 packets are being generated in response to a _getdir_ REQUEST, and 1341 that the assembled DATA contents should be interpreted as a sequence 1342 of Directory Records, as defined in Section 5. 1344 +-----+-------+-----------------------------------------------------+ 1345 | Bit | Value | Meaning | 1346 +-----+-------+-----------------------------------------------------+ 1347 | 12 | 0 | This packet does not include an optional | 1348 | | | timestamp/nonce field. | 1349 | 12 | 1 | This packet includes an optional timestamp/nonce | 1350 | | | field. | 1351 +-----+-------+-----------------------------------------------------+ 1353 Flag bit 12 indicates that an optional packet timestamp/nonce is 1354 carried in the packet before the offset field. This packet 1355 timestamp/nonce field is always sixteen octets (128 bits) long. 1356 Timestamps can be useful to the sender even when the receiver does 1357 not understand them, as the receiver can simply echo any provided 1358 timestamps back, as specified for STATUS packets, to allow the sender 1359 to monitor flow conditions. Packet timestamps are particularly 1360 useful when streaming. Packet timestamps are discussed further in 1361 Appendix A. 1363 +-----+-------+-------------------------------+ 1364 | Bit | Value | Meaning | 1365 +-----+-------+-------------------------------+ 1366 | 15 | 0 | No response is requested. | 1367 | 15 | 1 | A STATUS packet is requested. | 1368 +-----+-------+-------------------------------+ 1370 Within the Flags field, if bit 15 of the packet is set, the file- 1371 receiver is to immediately generate a STATUS packet to provide the 1372 file-sender with up-to-date information regarding the status of the 1373 file transfer. This flag is set carefully and rarely. This flag may 1374 be set periodically, but infrequently. Asymmetric links with 1375 constrained backchannels can only carry a limited amount of STATUS 1376 packets before ack congestion becomes a problem. This flag SHOULD 1377 NOT be set if an unreliable stream is being transferred, or if 1378 multicast is in use. This flag SHOULD be set periodically for 1379 reliable file transfers, or reliable streaming. 1381 +-----+-------+----------------------------------+ 1382 | Bit | Value | Meaning | 1383 +-----+-------+----------------------------------+ 1384 | 16 | 0 | Normal use. | 1385 | 16 | 1 | The EOD End of Data flag is set. | 1386 +-----+-------+----------------------------------+ 1388 The End of Data flag is set in DATA packets carrying the last byte of 1389 a transfer. This is useful for streams and for Saratoga 1390 implementations that do not support METADATA. 1392 Immediately following the DATA header is the payload, which consumes 1393 the remainder of the packet and whose length is implicitly defined by 1394 the end of the packet. The payload octets are directly formed from 1395 the continuous octets starting at the specified Offset in the file 1396 being transferred. No special coding is performed. A zero-octet 1397 payload length is allowable. 1399 The length of the Offset fields used within all DATA packets for a 1400 given transaction MUST be consistent with the length indicated by 1401 bits 8 and 9 of the transactions METADATA packet. If the METADATA 1402 packet has not yet been received, a file-receiver SHOULD request it 1403 via a STATUS packet, and MAY choose to enqueue received DATA packets 1404 for later processing after the METADATA arrives. 1406 4.5. STATUS 1408 The STATUS packet type is the single acknowledgement method that is 1409 used for feedback from a Saratoga receiver to a Saratoga sender to 1410 indicate transaction progress, both as a response to a REQUEST, and 1411 as a response to a DATA packet when demanded or volunteered. 1413 When responding to a DATA packet, the STATUS packet MAY, as needed, 1414 include selective acknowledgement (SNACK) 'hole' information to 1415 enable transmission (usually re-transmission) of specific sets of 1416 octets within the current transaction (called "holes"). This 1417 'holestofill' information can be used to clean up losses (or indicate 1418 no losses) at the end of, or during, a transaction, or to efficiently 1419 resume a transfer that was interrupted in a previous transaction. 1421 Format 1423 0 1 2 3 1424 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 1425 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1426 |0 1| Type | Flags | Status | 1427 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1428 | Id | 1429 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1430 | / 1431 / Timestamp/nonce information (optional) / 1432 / / 1433 / | 1434 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1435 [ Progress Indicator (descriptor) ] 1436 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1437 [ In-Response-To (descriptor) ] 1438 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1439 | (possibly, several Hole fields) / 1440 / ... / 1441 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1443 where 1445 +----------------+--------------------------------------------------+ 1446 | Field | Description | 1447 +----------------+--------------------------------------------------+ 1448 | Type | 4 | 1449 | Flags | are defined below. | 1450 | Id | identifies the transaction that this packet | 1451 | | belongs to. | 1452 | Status | a value of 00 indicates the transfer is | 1453 | | sucessfully proceeding. All other values are | 1454 | | errors terminating the transfer, explained | 1455 | | below. | 1456 | Zero-Pad | an octet fixed at 00 to allow later fields to be | 1457 | | conveniently aligned for processing. | 1458 | Timestamp | an optional fixed 128-bit field, that is only | 1459 | (optional) | present and used to return a packet timestamp if | 1460 | | the timestamp flag is set. If the STATUS packet | 1461 | | is voluntary and the voluntary flag is set, this | 1462 | | should repeat the timestamp of the DATA packet | 1463 | | containing the highest offset seen. If the | 1464 | | STATUS packet is in response to a mandatory | 1465 | | request, this will repeat the timestamp of the | 1466 | | requesting DATA packet. The file-sender may use | 1467 | | these timestamps to estimate latency. Packet | 1468 | | timestamps are particularly useful when | 1469 | | streaming. There are special considerations for | 1470 | | streaming, to protect against the ambiguity of | 1471 | | wrapped offset descriptor sequence numbers, | 1472 | | discussed below. Packet timestamps are | 1473 | | discussed further in Appendix A. | 1474 | Progress | the offset of the lowest-numbered octet of the | 1475 | Indicator | file not yet received. | 1476 | In-Response-To | the offset of the highest-numbered octet within | 1477 | (descriptor) | a DATA packet that generated this STATUS packet, | 1478 | | or the offset of the highest-numbered octet seen | 1479 | | if this STATUS is generated voluntarily and the | 1480 | | voluntary flag is set. | 1481 | Holes | indications of offset ranges of missing data, | 1482 | | defined below. | 1483 +----------------+--------------------------------------------------+ 1485 The STATUS packet has a minimum size of twelve octets, using sixteen- 1486 bit descriptors, a progress indicator but no Hole fields, and no 1487 timestamps. The progress indicator is always zero when responding to 1488 requests that may initiate a transfer. 1490 The Id field is needed to associate the STATUS packet with the 1491 transaction that it refers to. 1493 Flags bits 8 and 9 are set to indicate the size of the offset 1494 descriptor as described for BEACON and METADATA packets, so that each 1495 STATUS packet is self-describing. The flag values here MUST be the 1496 same as indicated in the initial METADATA and DATA packets. 1498 Other bits in the Flags field are defined as: 1500 +-----+-------+---------------------------------------------------+ 1501 | Bit | Value | Meaning | 1502 +-----+-------+---------------------------------------------------+ 1503 | 12 | 0 | This packet does not include a timestamp field. | 1504 | 12 | 1 | This packet includes an optional timestamp field. | 1505 +-----+-------+---------------------------------------------------+ 1507 Flag bit 12 indicates that an optional sixteen-byte packet timestamp/ 1508 nonce field is carried in the packet before the Progress Indicator 1509 descriptor, as discussed for the DATA packet format. Packet 1510 timestamps are discussed further in Appendix A. 1512 +-----+-------+----------------------------------------+ 1513 | Bit | Value | Meaning | 1514 +-----+-------+----------------------------------------+ 1515 | 13 | 0 | file's METADATA has been received. | 1516 | 13 | 1 | file's METADATA has not been received. | 1517 +-----+-------+----------------------------------------+ 1519 If bit 13 of a STATUS packet has been set to indicate that the 1520 METADATA has not yet been received, then the METADATA should be 1521 resent. This flag should normally be clear. 1523 A receiver SHOULD tolerate lost METADATA that is later resent, but 1524 MAY insist on receiving METADATA at the start of a transfer. This is 1525 done by responding to early DATA packets with a voluntary STATUS 1526 packet that sets this flag bit, reports a status error code 10, sets 1527 the Progress Indicator field to zero, and does not include 1528 HOLESTOFILL information. 1530 +-----+-------+-----------------------------------------------------+ 1531 | Bit | Value | Meaning | 1532 +-----+-------+-----------------------------------------------------+ 1533 | 14 | 0 | this packet contains the complete current set of | 1534 | | | holes at the file-receiver. | 1535 | 14 | 1 | this packet contains incomplete hole-state; holes | 1536 | | | shown in this packet should supplement other | 1537 | | | incomplete hole-state known to the file-sender. | 1538 +-----+-------+-----------------------------------------------------+ 1540 Bit 14 of a 'holestofill' STATUS packet is only set when there are 1541 too many holes to fit within a single STATUS packet due to MTU 1542 limitations. This causes the hole list to be spread out over 1543 multiple STATUS packets, each of which conveys distinct sets of 1544 holes. This could occur, for instance, in a large file _put_ 1545 scenario with a long-delay feedback loop and poor physical layer 1546 conditions. These multiple STATUS packets will share In-Response-To 1547 information. When losses are light and/or hole reporting and repair 1548 is relatively frequent, all holes should easily fit within a single 1549 STATUS packet, and this flag will be clear. Bit 14 should normally 1550 be clear. 1552 In some rare cases of high loss, there may be too many holes in the 1553 received data to convey within a single STATUS's size, which is 1554 limited by the link MTU size. In this case, multiple STATUS packets 1555 may be generated, and Flags bit 14 should be set on each STATUS 1556 packet accordingly, to indicate that each packet holds incomplete 1557 results. The complete group of STATUS packets, each containing 1558 incomplete information, will share common In-Response-To information 1559 to distinguish them from any earlier groups. 1561 +-----+-------+-----------------------------------------------+ 1562 | Bit | Value | Meaning | 1563 +-----+-------+-----------------------------------------------+ 1564 | 15 | 0 | This STATUS was requested by the file-sender. | 1565 | 15 | 1 | This STATUS is sent voluntarily. | 1566 +-----+-------+-----------------------------------------------+ 1568 Flag bit 15 indicates whether the STATUS is sent voluntarily or due 1569 to a request by the sender. It affects content of the In-Response-To 1570 timestamp and descriptor fields. 1572 In the case of a transfer proceeding normally, immediately following 1573 the STATUS packet header shown above, is a set of "Hole" definitions 1574 indicating any lost packets. Each Hole definition is a pair of 1575 unsigned integers. For a 32-bit offset descriptor, each Hole 1576 definition consists of two four-octet unsigned integers: 1578 Hole Definition Format 1580 0 1 2 3 1581 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 1582 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1583 [ offset to start of hole (descriptor) ] 1584 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1585 [ offset to end of hole (descriptor) ] 1586 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1588 The start of the hole means the offset of the first unreceived byte 1589 in that hole. The end of the hole means the last unreceived byte in 1590 that hole. 1592 For 16-bit descriptors, each Hole definition holds two two-octet 1593 unsigned integers, while Hole definitions for 64- and 128-bit 1594 descriptors require two eight- and two sixteen-octet unsigned 1595 integers respectively. 1597 Since each Hole definition takes up eight octets when 32-bit offset 1598 lengths are used, we expect that well over 100 such definitions can 1599 fit in a single STATUS packet, given the IPv6 minimum MTU. (There 1600 may be cases where there is a very constrained backchannel compared 1601 to the forward channel streaming DATA packets. For these cases, 1602 implementations might deliberately request large holes that span a 1603 number of smaller holes and intermediate areas where DATA has already 1604 been received, so that previously-received DATA is deliberately 1605 resent. This aggrgation of separate holes keeps the backchannel 1606 STATUS packet size down to avoid backchannel congestion.) 1608 A 'voluntary' STATUS can be sent at the start of each transaction. 1609 This indicates that the receiver is ready to receive the file, or 1610 indicates an error or rejection code, described below. A STATUS 1611 indicating a successfully established transfer has a Progress 1612 Indicator of zero and an In-Response-To field of zero. 1614 On receiving a STATUS packet, the sender SHOULD prioritize sending 1615 the necessary data to fill those holes, in order to advance the 1616 Progress Indicator at the receiver. 1618 The sender infers a completely-received transfer from the reported 1619 receiver window position. In the final STATUS packet sent by the 1620 receiver once the file to be transferred has been completely 1621 received, bit 14 MUST be 0 (indicating a complete set of holes in 1622 this packet), there MUST NOT be any holestofill offset pairs 1623 indicating holes, the In-Response-To field points to the last byte of 1624 the file, and the voluntary flag MUST be set. This 'completed' 1625 STATUS may be repeated, depending on subsequent sender behaviour, 1626 while internal state about the transfer remains available to the 1627 receiver. 1629 Because METADATA is optional in implementations, the file receiver 1630 may not know the length of a file if METADATA is never sent. The 1631 sender MUST set the EOD End of Data flag in each DATA packet that 1632 sends the last byte of the file, and SHOULD request a STATUS 1633 acknowledgement when the EOD flag is set. If METADATA has been sent 1634 and the EOD comes earlier than a previously reported length of a 1635 file, an unspecified error 0x01, as described below, is returned in 1636 the STATUS message responding to that DATA packet and EOD flag. If a 1637 stream is being marked EOD, the receiver acknowledges this with a 1638 Success 0x00 code. 1640 In the case of an error causing a transfer to be aborted, the Status 1641 field holds a code that can be used to explain the cause of the error 1642 to the other peer. A zero value indicates that there have been no 1643 significant errors (this is called a "success STATUS" within this 1644 document), while any non-zero value means the transaction should be 1645 aborted (this is called a "failure STATUS"). 1647 +----------------+--------------------------------------------------+ 1648 | Error Code | Meaning | 1649 | Status Value | | 1650 +----------------+--------------------------------------------------+ 1651 | 0x00 | Success, No Errors. | 1652 | 0x01 | Unspecified Error. | 1653 | 0x02 | Unable to send file due to resource constraints. | 1654 | 0x03 | Unable to receive file due to resource | 1655 | | constraints. | 1656 | 0x04 | File not found. | 1657 | 0x05 | Access Denied. | 1658 | 0x06 | Unknown Id field for transaction. | 1659 | 0x07 | Did not delete file. | 1660 | 0x08 | File length is longer than receiver can support. | 1661 | 0x09 | File offset descriptors do not match expected | 1662 | | use or file length. | 1663 | 0x0A | Unsupported Saratoga packet type received. | 1664 | 0x0B | Unsupported Request Type received. | 1665 | 0x0C | REQUEST is now terminated due to an internal | 1666 | | timeout. | 1667 | 0x0D | DATA flag bits describing transfer have changed | 1668 | | unexpectedly. | 1669 | 0x0E | Receiver is no longer interested in receiving | 1670 | | this file. | 1671 | 0x0F | File is in use. | 1672 | 0x10 | METADATA required before transfer can be | 1673 | | accepted. | 1674 | 0x11 | A STATUS error message has been received | 1675 | | unexpectedly, so REQUEST is terminated. | 1676 +----------------+--------------------------------------------------+ 1678 The recipient of a failure STATUS MUST NOT try to process the 1679 Progress Indicator, In-Response-To, or Hole offsets, because, in some 1680 types of error conditions, the packet's sender may not have any way 1681 of setting them to the right length for the transaction. 1683 When sending an indefinite-length stream, the possibility of offset 1684 sequence numbers wrapping back to zero must be considered. This can 1685 be protected against by using large offsets, and by the stream 1686 receiver. The receiver MUST separate out holes before the offset 1687 wraps to zero from holes after the wrap, and send Hole definitions in 1688 different STATUS packets, with Flag 14 set to mark them as 1689 incomplete. Any Hole straddling a sequence wrap MUST be broken into 1690 two separate Holes, with the second Hole starting at zero. The 1691 timestamps in STATUS packets carrying any pre-wrap holes should be 1692 earlier than the timestamp in later packets, and should repeat the 1693 timestamp of the last DATA packet seen for that offset sequence 1694 before the following wrap to zero occurred. Receivers indicate that 1695 they no longer wish to receive streams by sending Status Code 0C. 1697 5. The Directory Entry 1699 Directory Entries have two uses within Saratoga: 1701 1. Within a METADATA packet, a Directory Entry is used to give 1702 information about the file being transferred, in order to 1703 facilitate proper reassembly of the file and to help the file- 1704 receiver understand how recently the file may have been created 1705 or modified. 1707 2. When a peer requests a directory listing via a _getdir_ REQUEST, 1708 the other peer generates a file containing a series of one or 1709 more concatenated Directory Entry records, and transfers this 1710 file as it would transfer the response to a normal _get_ REQUEST, 1711 sending the records together within DATA packets. This file may 1712 be either temporary or within-memory and not actually a part of 1713 the host's file system itself. 1715 Directory Entry Format 1717 0 1 2 3 1718 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 1719 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1720 | Properties [ Size (descriptor) ] 1721 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1722 | Mtime | 1723 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1724 | Ctime | 1725 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1726 | / 1727 + / 1728 / / 1729 / File Path (max 1024 octets,variable length) / 1730 / ... // 1731 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-// 1733 where 1734 +------------+------------------------------------------------------+ 1735 | field | description | 1736 +------------+------------------------------------------------------+ 1737 | Properties | if set, bit 7 of this field indicates that the entry | 1738 | | corresponds to a directory. Bit 6, if set, | 1739 | | indicates that the file is "special". A special | 1740 | | file may not be directly transferable as it | 1741 | | corresponds to a symbolic link, a named pipe, a | 1742 | | device node, or some other "special" filesystem | 1743 | | object. A file-sender may simply choose not to | 1744 | | include these types of files in the results of a | 1745 | | _getdir_ request. Bits 8 and 9 are flags that | 1746 | | indicate the width of the following descriptor field | 1747 | | that gives file size. Bit 10 indicates that the | 1748 | | file is to be handled by Saratoga as a bundle, and | 1749 | | passed to a bundle agent. | 1750 | Size | the size of each file or directory in octets. This | 1751 | | is a descriptor, varying as needed in each entry for | 1752 | | the size of the file. For convenience in the | 1753 | | figure, it is shown here as a 16-bit descriptor for | 1754 | | a small file. | 1755 | Mtime | a timestamp showing when the file or directory was | 1756 | | modified. | 1757 | Ctime | a timestamp of the last status change for this file | 1758 | | or directory. | 1759 | File Path | contains the file's name relative within the | 1760 | | requested path of the _getdir_ transaction, a | 1761 | | maximum of 1024-octet UTF-8 string, that is | 1762 | | null-terminated to indicate the beginning of the | 1763 | | next directory entry in _getdir_ results. | 1764 +------------+------------------------------------------------------+ 1766 +-------+-------+---------------------+ 1767 | Bit 6 | Bit 7 | Properties conveyed | 1768 +-------+-------+---------------------+ 1769 | 0 | 0 | normal file. | 1770 | 0 | 1 | normal directory. | 1771 | 1 | 0 | special file. | 1772 | 1 | 1 | special directory. | 1773 +-------+-------+---------------------+ 1775 Streams listed in a directory should be marked as special. If a 1776 stream is being transferred, its size is unknown -- otherwise it 1777 would be a file. The size property of a Directory Entry for a stream 1778 is therefore expected to be zero. 1780 +-------+-------+-------------------------------------------------+ 1781 | Bit 8 | Bit 9 | Properties conveyed | 1782 +-------+-------+-------------------------------------------------+ 1783 | 0 | 0 | File size is indicated in a 16-bit descriptor. | 1784 | 0 | 1 | File size is indicated in a 32-bit descriptor. | 1785 | 1 | 0 | File size is indicated in a 64-bit descriptor. | 1786 | 1 | 1 | File size is indicated in a 128-bit descriptor. | 1787 +-------+-------+-------------------------------------------------+ 1789 Flag bits 8 and 9 of Properties are descriptor size flags, with 1790 similar meaning as elsewhere, describing the size of the File Size 1791 descriptor that follows the Properties field. When a single 1792 Directory Entry appears in the METADATA packet, these flags SHOULD 1793 match flag bits 8 and 9 in the METADATA header. (A smaller 1794 descriptor size may be indicated in the Directory Entry when doing 1795 test transfers of small files using large descriptors.) 1797 +--------+------------------------------------+ 1798 | Bit 10 | Properties conveyed | 1799 +--------+------------------------------------+ 1800 | 0 | File really is a file. | 1801 | 1 | File is to be treated as a bundle. | 1802 +--------+------------------------------------+ 1804 Bit 10 of Directory Entry Properties is a bundle flag, as indicated 1805 in and matching the METADATA header. Use of Saratoga with bundles is 1806 discussed further in [I-D.wood-dtnrg-saratoga]. 1808 +--------+----------------------------------------------------------+ 1809 | Bit 13 | Use | 1810 +--------+----------------------------------------------------------+ 1811 | 0 | This file's content MUST be delivered reliably without | 1812 | | errors using UDP. | 1813 | 1 | This file's content MAY be delivered unreliably, or | 1814 | | partly unreliably, where errors are tolerated, using | 1815 | | UDP-Lite. | 1816 +--------+----------------------------------------------------------+ 1818 Bit 13 indicates whether the file must be sent reliably or can be 1819 sent at least partly unreliably, using UDP-Lite. This matches 1820 METADATA flag use. 1822 Undefined or unused flag bits of the Properties field default to 1823 zero. In general, bits 0-7 of Properties are for matters related to 1824 the sender's filesystem, while bits 8-15 are for matters related to 1825 transport over Saratoga. 1827 It may be reasonable that files are visible in Directory Entries only 1828 when they can be transferred to the requester - this may depend on 1829 e.g. having appropriate access permissions or being able to handle 1830 large filesizes. But requesters only capable of handling small files 1831 MUST be able to skip through large descriptors for large file sizes. 1832 Directory sizes are not calculated or sent, and a Size of 0 is given 1833 instead for directories, which are considered zero-length files. 1835 The "epoch" format used in the timestamps for Mtime and Ctime in file 1836 object records is the number of seconds since January 1, 2000 in UTC, 1837 which is the same epoch used in the DTN Bundle Protocol for 1838 timestamps and postpones wrapping for 30 years beyond typical 1970- 1839 based timestamps. This should include all leapseconds. 1841 A file-receiver should preserve the timestamp information received in 1842 the METADATA for its own copy of the file, to allow newer versions of 1843 files to propagate and supercede older versions. 1845 6. Behaviour of a Saratoga Peer 1847 This section describes some details of Saratoga implementations and 1848 uses the RFC 2119 standards language to describe which portions are 1849 needed for interoperability. 1851 6.1. Saratoga Transactions 1853 Following are descriptions of the packet exchanges between two peers 1854 for each type of transaction. Exchanges rely on use of the Id field 1855 to match responses to requests, as described earlier in Section 4.2. 1857 6.1.1. The _get_ Transaction 1859 1. A peer (the file-receiver) sends a REQUEST packet to its peer 1860 (the file-sender). The Flags bits are set to indicate that this 1861 is not a _delete_ request, nor does the File Path indicate a 1862 directory. Each _get_ transaction corresponds to a single file, 1863 and fetching multiple files requires sending multiple REQUEST 1864 packets and using multiple different transaction Ids so that 1865 responses can be differentiated and matched to REQUESTs based on 1866 the Id field. If a specific file is being requested, then its 1867 name is filled into the File Path field, otherwise it is left 1868 null and the file-sender will send a file of its choice. 1870 2. If the _get_ request is rejected, then a STATUS packet containing 1871 an error code in the Status field is sent and the transaction is 1872 terminated. This STATUS packet MUST be sent to reject and 1873 terminate the transaction. The error code MAY make use of the 1874 "Unspecified Error" value for security reasons. Some REQUESTs 1875 might also be rejected for specifying files that are too large to 1876 have their lengths encoded within the maximum integer field width 1877 advertised by bits 8 and 9 of the REQUEST. 1879 3. If the _get_ request is accepted, then a STATUS packet MAY be 1880 sent with an error code of 00 and an In-Response-To field of 1881 zero, to indicate acceptance. Sending other packets (METADATA or 1882 DATA) also indicates acceptance. The file-sender SHOULD generate 1883 and send a METADATA packet. The sender MUST send the contents of 1884 the file or stream as a series of DATA packets. In the absence 1885 of STATUS packets being requested from the receiver, if the file- 1886 sender believes it has finished sending the file and is not on a 1887 unidirectional link, it MUST send the last DATA packet with the 1888 Flags bit set requesting a STATUS response from the file- 1889 receiver. The last DATA packet MUST always have its End of Data 1890 (EOD) bit set. This can be followed by empty DATA packets with 1891 the Flags bits set with EOD and requesting a STATUS until either 1892 a STATUS packet is received, or the inactivity timer expires. 1893 All of the DATA packets MUST use field widths for the file offset 1894 descriptor fields that match what the Flags of the METADATA 1895 packet specified. Some arbitrarily selected DATA packets may 1896 have the Flags bit set that requests a STATUS packet. The file- 1897 receiver MAY voluntarily send STATUS packets at other times, 1898 where the In-Response-To field MUST set to zero. The file- 1899 receiver SHOULD voluntarily send a STATUS packet in response to 1900 the first DATA packet. 1902 4. As the file-receiver takes in the DATA packets, it writes them 1903 into the file locally. The file-receiver keeps track of missing 1904 data in a hole list. Periodically the file sender will set the 1905 ack flag bit in a DATA packet and request a STATUS packet from 1906 the file-receiver. The STATUS packet can include a copy of this 1907 hole list if there are holes. File-receivers MUST send a STATUS 1908 packet immediately in response to receiving a DATA packet with 1909 the Flags bit set requesting a STATUS. 1911 5. If the file-sender receives a STATUS packet with a non-zero 1912 number of holes, it re-fetches the file data at the specified 1913 offsets and re-transmits it. If the METADATA packet requires 1914 retransmission, this is indicated by a bit in the STATUS packet, 1915 and the METADATA packet is retransmitted. The file-sender MUST 1916 retransmit data from any holes reported by the file-receiver 1917 before proceeding further with new DATA packets. 1919 6. When the file-receiver has fully received the file data and the 1920 METADATA packet, then it sends a STATUS packet indicating that 1921 the transaction is complete, and it terminates the transaction 1922 locally, although it MUST persist in responding to any further 1923 DATA packets received from the file-sender with 'completed' 1924 STATUSes, as described in Section 4.5, for some reasonable amount 1925 of time. Starting a timer on sending a completed STATUS and 1926 resetting it whenever a received DATA/sent 'completed' STATUS 1927 transaction takes place, then removing all session state on timer 1928 expiry, is one approach to this. 1930 Given that there may be a high degree of asymmetry in link bandwidth 1931 between the file-sender and file-receiver, the STATUS packets should 1932 be carefully generated so as to not congest the feedback path. This 1933 means that both a file-sender should be cautious in setting the DATA 1934 Flags bit requesting STATUSes, and also that a file-receiver should 1935 be cautious in gratuitously generating STATUS packets of its own 1936 volition. When sending on known unidirectional links, a file-sender 1937 cannot reasonably expect to receive STATUS packets, so should never 1938 request them. 1940 6.1.2. The _getdir_ Transaction 1942 A _getdir_ transaction proceeds through the same states as the _get_ 1943 transaction. The two differences are that the REQUEST has the 1944 directory bit set in its Flags field, and that, rather than 1945 transferring the contents of a file from the file-receiver to the 1946 file-sender, a set of records representing the contents of a 1947 directory are transferred. These can be parsed and dealt with by the 1948 file-receiver as desired. There is no requirement that a Saratoga 1949 peer send the full contents of a directory listing; a peer may filter 1950 the results to only those entries that are actually accessible to the 1951 requesting peer. 1953 For _getdir_ transactions, the METADATA's bits 8 and 9 in the Flags 1954 field specify both the width of the offset and length fields used 1955 within the transfers DATA and STATUS packets, and also the width of 1956 file Size fields within Directory Entries in the interpreted _getdir_ 1957 results. These Flags bits are set to the minimum of the file- 1958 sender's locally-supported maximum width and the advertised maximum 1959 width within the REQUEST packet, and any file system entries that 1960 would normally be contained in the results, but that have sizes 1961 greater than this width can convey, MUST be filtered out. 1963 6.1.3. The _delete_ Transaction 1965 1. A peer sends a REQUEST packet with the bit set indicating that it 1966 is a deletion request and the path to be deleted is filled into 1967 the File Path field. The File Path MUST be filled in for 1968 _delete_ transactions, unlike for _get_ transactions. 1970 2. The other peer replies with a feedback STATUS packet whose Id 1971 matches the Id field of the _delete_ REQUEST. This STATUS has a 1972 Status code that indicates that the file is not currently present 1973 on the filesystem (indicated by the 00 Status field in a success 1974 STATUS), or whether some error occurred (indicated by the non- 1975 zero Status field in a failure STATUS). This STATUS packet MUST 1976 have no Holes and 16-bit width zero-valued Progress Indicator and 1977 In-Response-To fields. 1979 If a request is received to delete a file that is already deleted, a 1980 STATUS with Status code 00 and other fields as described above is 1981 sent back in acknowledgement. This response indicates that the 1982 indicated file is not present, not the exact action sequence that led 1983 to a not-present file. This idempotent behaviour ensures that loss 1984 of STATUS acknowledgements and repeated _delete_ requests are handled 1985 properly. 1987 6.1.4. The _put_ Transaction 1989 A _put_ transaction proceeds as a _get_ does, except the file-sender 1990 and file-receiver roles are exchanged between peers, and no REQUEST 1991 packet is ever sent. The file-sending end senses that the 1992 transaction is in progress when it receives METADATA or DATA packets 1993 for which it has no knowledge of the Id field. If the file-receiver 1994 decides that it will store and handle this request (at least 1995 provisionally), then it MUST send a voluntary (ie, not requested) 1996 success STATUS packet to the file-sender. Otherwise, it sends a 1997 failure STATUS packet. After sending a failure STATUS packet, it may 1998 ignore future packets with the same Id field from the file-sender, 1999 but it should, at a low rate, periodically regenerate the failure 2000 STATUS packet if the flow of packets does not stop. 2002 6.2. Beacons 2004 Sending BEACON packets is not required in any of the transactions 2005 discussed in this specification, but optional BEACONs can provide 2006 useful information in many situations. If a node periodically 2007 generates BEACON packets, then it should do so at a low rate which 2008 does not significantly affect in-progress data transfers. 2010 A node that supports multiple versions of Saratoga (e.g. version 1 2011 from this specification along with the older version 0), MAY send 2012 multiple BEACON packets showing different version numbers. The 2013 version number in a single BEACON should not be used to infer the 2014 larger set of protocol versions that a peer is compatible with. 2015 Similarly, a node capable of communicating via IPv4 and IPv6 MAY send 2016 separate BEACONs via both protocols, or MAY only send BEACONs on its 2017 preferred protocol. 2019 If a node receives BEACONs from a peer, then it SHOULD NOT attempt to 2020 start any _get_, _getdir_, or _delete_ transactions with that peer if 2021 bit 14 is not set in the latest received BEACONs. Likewise, if 2022 received BEACONs from a peer do not have bit 15 set, then _put_ 2023 transactions SHOULD NOT be attempted to that peer. Unlike the 2024 capabilities bits which prevent certain types of transactions from 2025 being attempted, the willingness bits are advisory, and transactions 2026 MAY be attempted even if the node is not advertising a willingness, 2027 as long as it advertises a capability. This avoids waiting for a 2028 willingness indication across long-delay links. 2030 6.3. Upper-Layer Interface 2032 No particular application interface functionality is required in \ 2033 implementations of this specification. The means and degree of 2034 access to Saratoga configuration settings, and transaction control 2035 that is offered to upper layers and applications, are completely 2036 implementation-dependent. In general, it is expected that upper 2037 layers (or users) can set timeout values for transaction requests and 2038 for inactivity periods during the transaction, on a per-peer or per- 2039 transaction basis, but in some implementations where the Saratoga 2040 code is restricted to run only over certain interfaces with well- 2041 understood operational latency bounds, then these timers MAY be hard- 2042 coded. 2044 6.4. Inactivity Timer 2046 In order to determine the liveliness of a transaction, Saratoga nodes 2047 may implement an inactivity timer for each peer they are expecting to 2048 see packets from. For each packet received from a peer, its 2049 associated inactivity timer is reset. If no packets are received for 2050 some amount of time, and the inactivity timer expires, this serves as 2051 a signal to the node that it should abort (and optionally retry) any 2052 sessions that were in progress with the peer. Information from the 2053 link interface (i.e. link down) can override this timer for point-to- 2054 point links. 2056 The actual length of time that the inactivity timer runs for is a 2057 matter of both implementation and deployment situation. Relatively 2058 short timers (on the order of several round-trip times) allow nodes 2059 to quickly react to loss of contact, while longer timers allow for 2060 transaction robustness in the presence of transient link problems. 2061 This document deliberately does not specify a particular inactivity 2062 timer value nor any rules for setting the inactivity timer, because 2063 the protocol is intended to be used in both long- and short-delay 2064 regimes. 2066 Specifically, the inactivity timer is started on sending REQUEST or 2067 STATUS packets. When sending packets not expected to elicit 2068 responses (BEACON, METADATA, or DATA without acknowledgement 2069 requests), there is no point to starting the local inactivity timer. 2071 For normal file transfers, there are simple rules for handling 2072 expiration of the inactivity timer during a _get_ or _put_ 2073 transaction. Once the timer expires, the file-sender SHOULD 2074 terminate the transaction state and cease to send DATA or METADATA 2075 packets. The file-receiver SHOULD stop sending STATUS packets, and 2076 MAY choose to store the file in some cache location so that the 2077 transfer can be recovered. This is possible by waiting for an 2078 opportunity to re-attempt the transaction and immediately sending a 2079 STATUS that only lists the parts of the file not yet received if the 2080 transaction is granted. In any case, a partially-received file MUST 2081 NOT be handled in any way that would allow another application to 2082 think it is complete. 2084 The file-sender may implement more complex timers to allow rate-based 2085 pacing or simple congestion control using information provided in 2086 STATUS packets, but such possible timers and their effects are 2087 deliberately not specified here. 2089 7. Mailing list 2091 There is a mailing list for discussion of Saratoga and its 2092 implementations. Contact Lloyd Wood for details. 2094 8. Security Considerations 2096 The design of Saratoga provides limited, deliberately lightweight, 2097 services for authentication of session requests, and for 2098 authentication or encryption of data files via keyed metadata 2099 checksums. This document does not specify privacy or access control 2100 for data files transferred. Privacy, access, authentication and 2101 encryption issues may be addressed within an implementation or 2102 deployment in several ways that do not affect the file transfer 2103 protocol itself. As examples, IPSec may be used to protect Saratoga 2104 implementations from forged packets, to provide privacy, or to 2105 authenticate the identity of a peer. Other implementation-specific 2106 or configuration-specific mechanisms and policies might also be 2107 employed for authentication and authorization of requests. 2108 Protection of file data and meta-data can also be provided by a 2109 higher-level file encryption facility. If IPsec is not required, use 2110 of encryption before the file is given to Saratoga is preferable. 2111 Basic security practices like not accepting paths with "..", not 2112 following symbolic links, and using a chroot() system call, among 2113 others, should also be considered within an implementation. 2115 Note that Saratoga is intended for single-hop transfers between 2116 peers. A METADATA checksum using a previously shared key can be used 2117 to decrypt or authenticate delivered DATA files. Saratoga can only 2118 provide payload encryption across a single Saratoga transfer, not 2119 end-to-end across concatenated separate hop-by-hop transfers through 2120 untrusted peers, as checksum verification of file integrity is 2121 required at each node. End-to-end data encryption, if required, MUST 2122 be implemented by the application using Saratoga. 2124 9. IANA Considerations 2126 IANA has allocated port 7542 (tcp/udp) for use by Saratoga. 2128 saratoga 7542/tcp Saratoga Transfer Protocol 2129 saratoga 7542/udp Saratoga Transfer Protocol 2131 IANA has allocated a dedicated IPv4 all-hosts multicast address 2132 (224.0.0.108) and a dedicated IPv6 link-local multicast addresses 2133 (FF02:0:0:0:0:0:0:6c) for use by Saratoga. 2135 10. Acknowledgements 2137 Developing and deploying the on-orbit IP-based infrastructure of the 2138 Disaster Monitoring Constellation, in which Saratoga has proven 2139 useful, has taken the efforts of hundreds of people over more than a 2140 decade. We thank them all. 2142 We thank James H. McKim as an early contributor to Saratoga 2143 implementations and specifications, while working for RSIS 2144 Information Systems at NASA Glenn. We regard Jim as an author of 2145 this document, but are prevented by the boilerplate five-author limit 2146 from naming him earlier. 2148 We thank Stewart Bryant, Dale Mellor, Cathryn Peoples, Abu Zafar 2149 Shahriar and Dave Stewart for their review comments. 2151 Work on this document at NASA's Glenn Research Center was funded by 2152 NASA's Earth Science Technology Office (ESTO). 2154 11. A Note on Naming 2156 Saratoga is named for the USS Saratoga (CV-3), the aircraft carrier 2157 sunk at Bikini Atoll that is now a popular diving site. 2159 12. References 2161 12.1. Normative References 2163 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 2164 August 1980. 2166 [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, 2167 April 1992. 2169 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2170 Requirement Levels", BCP 14, RFC 2119, March 1997. 2172 [RFC3309] Stone, J., Stewart, R., and D. Otis, "Stream Control 2173 Transmission Protocol (SCTP) Checksum Change", RFC 3309, 2174 September 2002. 2176 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2177 10646", STD 63, RFC 3629, November 2003. 2179 12.2. Informative References 2181 [Hogie05] Hogie, K., Criscuolo, E., and R. Parise, "Using Standard 2182 Internet Protocols and Applications in Space", Computer 2183 Networks, Special Issue on Interplanetary Internet, vol. 2184 47, no. 5, pp. 603-650, April 2005. 2186 [I-D.ietf-ledbat-congestion] 2187 Shalunov, S., Hazel, G., Iyengar, J., and M. Kuehlewind, 2188 "Low Extra Delay Background Transport (LEDBAT)", 2189 draft-ietf-ledbat-congestion-06 (work in progress), 2190 May 2011. 2192 [I-D.wood-dtnrg-http-dtn-delivery] 2193 Wood, L. and P. Holliday, "Using HTTP for delivery in 2194 Delay/Disruption-Tolerant Networks", 2195 draft-wood-dtnrg-http-dtn-delivery-07 (work in progress), 2196 May 2011. 2198 [I-D.wood-dtnrg-saratoga] 2199 Wood, L., McKim, J., Eddy, W., Ivancic, W., and C. 2200 Jackson, "Using Saratoga with a Bundle Agent as a 2201 Convergence Layer for Delay-Tolerant Networking", 2202 draft-wood-dtnrg-saratoga-09 (work in progress), May 2011. 2204 [Ivancic10] 2205 Ivancic, W., Eddy, W., Stewart, D., Wood, L., Northam, J., 2206 and C. Jackson, "Experience with delay-tolerant networking 2207 from orbit", International Journal of Satellite 2208 Communications and Networking, Special Issue on best 2209 papers of the Fourth Advanced Satellite Mobile Systems 2210 Conference (ASMS 2008), vol. 28, issues 5-6, pp. 335-351, 2211 September-December 2010. 2213 [Jackson04] 2214 Jackson, C., "Saratoga File Transfer Protocol", Surrey 2215 Satellite Technology Ltd internal technical document , 2216 2004. 2218 [RFC0959] Postel, J. and J. Reynolds, "File Transfer Protocol", 2219 STD 9, RFC 959, October 1985. 2221 [RFC3366] Fairhurst, G. and L. Wood, "Advice to link designers on 2222 link Automatic Repeat reQuest (ARQ)", BCP 62, RFC 3366, 2223 August 2002. 2225 [RFC3828] Larzon, L-A., Degermark, M., Pink, S., Jonsson, L-E., and 2226 G. Fairhurst, "The Lightweight User Datagram Protocol 2227 (UDP-Lite)", RFC 3828, July 2004. 2229 [RFC5050] Scott, K. and S. Burleigh, "Bundle Protocol 2230 Specification", RFC 5050, November 2007. 2232 [RFC5348] Floyd, S., Handley, M., Padhye, J., and J. Widmer, "TCP 2233 Friendly Rate Control (TFRC): Protocol Specification", 2234 RFC 5348, September 2008. 2236 [RFC6151] Turner, S. and L. Chen, "Updated Security Considerations 2237 for the MD5 Message-Digest and the HMAC-MD5 Algorithms", 2238 RFC 6151, March 2011. 2240 [Shahriar11] 2241 Shahriar, A., Atiquzzaman, M., Ivancic, W., and L. Wood, 2242 "A sender-based TFRC for Saratoga: A rate control 2243 mechanism for a space-friendly transfer protocol", IEEE 2244 Aerospace Conference Big Sky, Montana, March 2010. 2246 [Wood07a] Wood, L., Ivancic, W., Hodgson, D., Miller, E., Conner, 2247 B., Lynch, S., Jackson, C., da Silva Curiel, A., Cooke, 2248 D., Shell, D., Walke, J., and D. Stewart, "Using Internet 2249 Nodes and Routers Onboard Satellites", International 2250 Journal of Satellite Communications and 2251 Networking, Special Issue on Space Networks, vol. 25, no. 2252 2, pp. 195-216, March/April 2007. 2254 [Wood07b] Wood, L., Eddy, W., Ivancic, W., Miller, E., McKim, J., 2255 and C. Jackson, "Saratoga: a Delay-Tolerant Networking 2256 convergence layer with efficient link utilization", 2257 International Workshop on Satellite and Space 2258 Communications (IWSSC '07) Salzburg, September 2007. 2260 [Wood11] Wood, L., Smith, C., Eddy, W., Ivancic, W., and C. 2261 Jackson, "Taking Saratoga from space-based ground sensors 2262 to ground-based space sensors", IEEE Aerospace 2263 Conference Big Sky, Montana, March 2010. 2265 Appendix A. Timestamp/Nonce field considerations 2267 Timestamps are useful in DATA packets when the time that the packet 2268 or its payload was generated is of importance; this can be necessary 2269 when streaming sensor data recorded and packetized in real time. The 2270 format of the optional timestamp, whose presence is indicated by a 2271 flag bit, is implementation-dependent within the available fixed- 2272 length 128-bit field. How the contents of this timestamp field are 2273 used and interpreted depends on local needs and conventions and the 2274 local implementation. 2276 However, one simple suggested format for timestamps is to begin with 2277 a POSIX time_t representation of time, in network byte order. This 2278 is either a 32-bit or 64-bit signed integer representing the number 2279 of seconds since 1970. The remainder of this field can be used 2280 either for a representation of elapsed time within the current 2281 second, if that level of accuracy is required, or as a nonce field 2282 uniquely identifying the packet or including other information. Any 2283 locally-meaningful flags identifying a type of timestamp or timebase 2284 can be included before the end of the field. Unused parts of this 2285 field MUST be set to zero. 2287 There are many different representations of timestamps and timebases, 2288 and this draft is too short to cover them in detail. One suggested 2289 flag representation of different timestamp fields is to use the least 2290 significant bits at the end of the timestamp/nonce field as: 2292 +---------+---------------------------------------------------------+ 2293 | Status | Meaning | 2294 | Value | | 2295 +---------+---------------------------------------------------------+ 2296 | 00 | No flags set, local interpretation of field. | 2297 | 01 | 32-bit timestamp at start of field indicating whole | 2298 | | seconds from epoch. | 2299 | 02 | 64-bit timestamp at start of field indicating whole | 2300 | | seconds elapsed from epoch. | 2301 | 03 | 32-bit timestamp, as in 01, followed by 32-bit | 2302 | | timestamp indicating fraction of the second elapsed. | 2303 | 04 | 64-bit timestamp, as in 02, followed by 32-bit | 2304 | | timestamp indicating fraction of the second elapsed. | 2305 +---------+---------------------------------------------------------+ 2307 Other values may indicate specific epochs or timebases, as local 2308 requirements dictate. There are many ways to define and use time 2309 usefully. 2311 Echoing timestamps back to the file-sender is also useful for 2312 tracking flow conditions. This does not require the echoing receiver 2313 to understand the timestamp format or values in use. The use of 2314 timestamp values may assist in developing algorithms for flow control 2315 (including TCP-Friendly Rate Control [Shahriar11]) or other purposes. 2316 Timestamp values provide a useful mechanism for Saratoga peers to 2317 measure path and round-trip latency. 2319 Authors' Addresses 2321 Lloyd Wood 2322 Centre for Communication Systems Research, University of Surrey 2323 Guildford, Surrey GU2 7XH 2324 United Kingdom 2326 Phone: +44-1483-689123 2327 Email: L.Wood@surrey.ac.uk 2329 Wesley M. Eddy 2330 MTI Systems 2331 MS 500-ASRC 2332 NASA Glenn Research Center 2333 21000 Brookpark Road 2334 Cleveland, OH 44135 2335 USA 2337 Phone: +1-216-433-6682 2338 Email: wes@mti-systems.com 2339 Charles Smith 2340 Commonwealth Scientific and Industrial Research Organisation 2341 Cnr Vimiera and Pembroke Roads 2342 Marsfield, New South Wales 2122 2343 Australia 2345 Phone: +61-404-058974 2346 Email: charles.smith@csiro.au 2348 Will Ivancic 2349 NASA Glenn Research Center 2350 21000 Brookpark Road, MS 54-5 2351 Cleveland, OH 44135 2352 USA 2354 Phone: +1-216-433-3494 2355 Email: William.D.Ivancic@grc.nasa.gov 2357 Chris Jackson 2358 Surrey Satellite Technology Ltd 2359 Tycho House 2360 Surrey Space Centre 2361 20 Stephenson Road 2362 Guildford, Surrey GU2 7YE 2363 United Kingdom 2365 Phone: +44-1483-803803 2366 Email: C.Jackson@sstl.co.uk