INTERNET-DRAFT M. Johnston expires: December, 2003 Intel Corporation June, 2003 TFTP Restart and Session Option Definitions draft-johnston-tftp-restart-session-00.txt Status of This Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at: http://www.ietf.org/ietf/1id-abstracts.txt The list of Internet-Draft Shadow Directories can be accessed at: http://www.ietf.org/shadow.html Copyright Notice Copyright (C) The Internet Society (2003). All rights reserved. Abstract This document describes a mechanism that can be used by TFTP [1] and multicast TFTP (MTFTP) clients to restart aborted image downloads. M. Johnston draft-johnston-tftp-restart-session-00.txt [Page 1] Internet Draft TFTP Restart and Session Option June, 2003 Table of Contents Status of This Memo......................................1 Copyright Notice.........................................1 Abstract.................................................1 Table of Contents........................................2 1 Introduction..........................................3 2 Packet Information....................................3 2.1 Read Request Packet (RRQ).........................3 2.2 Data Packet (DATA)................................4 2.3 Option Acknowledgement Packet (OACK)..............4 3 Examples..............................................5 3.1 Server Does Not Have Option Extension Support.....5 3.2 Server Does Not Support Session And Restart Options5 3.3 Server Does Support Sesion and Restart Options....6 4 Security Considerations...............................7 5 References............................................7 6 AuthorĘs Address......................................7 7 Full Copyright Statement..............................7 M. Johnston draft-johnston-tftp-restart-session-00.txt [Page 2] Internet Draft TFTP Restart and Session Option June, 2003 1 Introduction If the download of a very large image (say greater than 1GB) is aborted, it can take the client several minutes to re-download the beginning of the image after establishing a new connection to the server. This document defines two new TFTP options that can be used by the client and server to negotiate a different starting block number within the image to be downloaded, reducing both the network traffic and time spent waiting for the download to complete. 2 Packet Information Detailed information about TFTP packet op-codes and formats can be found in [1] and [2]. This document only covers the changes required when implementing the "restart" and "session" options. All option and value strings are not case dependent, as defined in [2]. For example, the option strings "Session", "session" and "SESSION" must be treated the same by the client and server. 2.1 Read Request Packet (RRQ) 2-bytes string string string string -------------------------------------------------------------- | OpCode | Filename | 0 | Mode | 0 | Option | 0 | Value | 0 | -------------------------------------------------------------- The "session" option is used to verify that the image to be downloaded has not been altered on the server. The "restart" option is used to let the server know which packet in the image the client would like to receive next. At the beginning of a new download session the client creates a RRQ packet that includes a "session" option string with the value string set to "new". The server must change the "session" option value string in the OACK packet. The returned value string must be used verbatim by the client in all restart attempts of the same image. To restart an aborted download session the client creates a new RRQ packet that includes the "session" and "restart" options. The "session" option value string is copied from the OACK packet of the first download attempt of the image. M. Johnston draft-johnston-tftp-restart-session-00.txt [Page 3] Internet Draft TFTP Restart and Session Option June, 2003 The "restart" option value string contains the block number that the client wants to receive next. If the "session" value string is not "new" and does not match an active session string on the server, the server must return an ERROR packet with the ErrorCode field set to 8 (options error), as defined in [2]. If the starting position requested by the client is beyond the end of the file, the server must return an ERROR packet with the ErrorCode field set to 8 (options error). The "blksize" option MAY be used with the "session" and "restart" options. 2.2 Data Packet (DATA) 2-bytes 2-bytes n-bytes ----------------------------- | OpCode | Block# | Data | ----------------------------- If the server does support and use the "session" and "restart" options, the first DATA packet transmitted to the client (after the client acknowledges the OACK packet) must have a Block# equal to the "restart" option value string in the OACK packet. If the Block# in the first DATA packet received by the client is not equal to the "restart" option value string, this must be treated as an error and the client must terminate the session by sending an ERROR packet with the ErrorCode set to 4 (illegal TFTP operation). If the server does not support TFTP options, does not support the "restart" and "session" options or determines that not enough time or network resources will be saved by using these options, it may respond to the client RRQ with the first DATA packet (Block# set to 1). 2.3 Option Acknowledgement Packet (OACK) 2-bytes string string ----------------------------------- | OpCode | Option | 0 | Value | 0 | ----------------------------------- The server may change the contents of the "restart" and "blksize" option value strings in the OACK packet as long M. Johnston draft-johnston-tftp-restart-session-00.txt [Page 4] Internet Draft TFTP Restart and Session Option June, 2003 as the resulting starting location in the download image is not beyond that given in the RRQ packet. The server MUST change the "session" option value string from "new" to a valid session string. If the client receives a "session" option value string of "new" from the server, it must treat this as an error and the client must terminate the session by sending an ERROR packet with the ErrorCode set to 8 (option error). If the client receives a different "session" option value string from the server when trying to restart an aborted download, if must treat this as an error and the client must terminate the session by sending an ERROR packet with the ErrorCode set to 8 (option error). If the server does not support the "session" and "restart" options or decides that not enough time or network resources will be saved by using these options, it may leave them out of the OACK packet as defined in [2]. 3 Examples 3.1 Server Does Not Have Option Extension Support In this example the client sends an initial RRQ packet with the "session" option and the server responds with the first DATA packet (Block# set to 1). The client decides to continue the transfer by responding with ACK packets. client server ----------------------------------------------------------- |1|foofile|0|octet|0|blocksize|0|1024|0| |session|0|new|0| --> RRQ <-- |3|1| n octets of data | DATA |4|1| --> ACK <-- |3|2| n octets of data | DATA |4|2| --> ACK . . . <-- |3|8| n octets of data | DATA |4|8| --> ACK <-- |3|9| ACK 3.2 Server Does Not Support Session And Restart Options In this example the client sends an initial RRQ packet with the "session" option and the server responds with an OACK packet that does not contain the "session" option. The M. Johnston draft-johnston-tftp-restart-session-00.txt [Page 5] Internet Draft TFTP Restart and Session Option June, 2003 client decides to continue the transfer by responding with ACK packets. client server ----------------------------------------------------------- |1|foofile|0|octet|0|blocksize|0|1024|0| |session|0|new|0| --> RRQ <-- |6|blocksize|0|1024|0| OACK |4|0| --> ACK <-- |3|1| n octets of data | DATA |4|1| --> ACK <-- |3|2| n octets of data | DATA |4|2| --> ACK . . . <-- |3|8| n octets of data | DATA |4|8| --> ACK <-- |3|9| ACK 3.3 Server Does Support Sesion and Restart Options In this example the client sends an initial RRQ with the "session" option and the server responds with an OACK packet that does contain the "session" option and new option value string. The session times out after the fourth DATA packet and the client terminates the session with an ERROR packet and restarts the download on the fifth packet. client server ----------------------------------------------------------- |1|foofile|0|octet|0|blocksize|0|1024|0| |session|0|new|0| --> RRQ <-- |6|blocksize|0|1024|0|session|0|42|0| OACK |4|0| --> ACK <-- |3|1| n octets of data | DATA |4|1| --> ACK <-- |3|2| n octets of data | DATA |4|2| --> ACK <-- |3|3| n octets of data | DATA |4|3| --> ACK <-- |3|4| n octets of data | DATA |4|4| --> ACK |4|4| --> ACK |4|4| --> ACK |5|0|timeout|0| --> ERROR |1|foofile|0|octet|0|blocksize|0|1024|0| |session|0|42|0|restart|0|5|0| --> RRQ <-- |6|blocksize|0|1024|0|session|0|42|0| |restart|0|5|0| OACK |4|0| --> ACK M. Johnston draft-johnston-tftp-restart-session-00.txt [Page 6] Internet Draft TFTP Restart and Session Option June, 2003 <-- |3|5| n octets of data | DATA |4|5| --> ACK <-- |3|6| n octets of data | DATA |4|6| --> ACK <-- |3|7| n octets of data | DATA |4|7| --> ACK <-- |3|8| n octets of data | DATA |4|8| --> ACK <-- |3|9| ACK 4 Security Considerations The basic TFTP protocol has no security mechanism. This is why it has no rename, delete, or file overwrite capabilities. This document does not add any security to TFTP; however, the specified extension does not add any additional security risks. 5 References [1] The TFTP Protocol (Revision 2) RFC 783 [2] TFTP Option Extension RFC 2347 [3] TFTP Blocksize Option RFC 2348 6 AuthorĘs Address Michael Johnston Intel Corporation MS. JF1-239 2111 NE 25th Ave. Hillsboro, OR 97124 Phone: +1 503-264-9703 Email: michael.johnston@intel.com 7 Full Copyright Statement Copyright (C) The Internet Society (2003). All Rights Reserved. M. Johnston draft-johnston-tftp-restart-session-00.txt [Page 7] Internet Draft TFTP Restart and Session Option June, 2003 This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY, THE INTERNET ENGINEERING TASK FORCE, THE AUTHOR AND THE AUTHORĘS EMPLOYER DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. M. Johnston draft-johnston-tftp-restart-session-00.txt [Page 8]