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