Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

309 lines
11 KiB

  1. Network Working Group G. Malkin
  2. Request for Comments: 1782 Xylogics, Inc.
  3. Updates: 1350 A. Harkin
  4. Category: Standards Track Hewlett Packard Co.
  5. March 1995
  6. TFTP Option Extension
  7. Status of this Memo
  8. This document specifies an Internet standards track protocol for the
  9. Internet community, and requests discussion and suggestions for
  10. improvements. Please refer to the current edition of the "Internet
  11. Official Protocol Standards" (STD 1) for the standardization state
  12. and status of this protocol. Distribution of this memo is unlimited.
  13. Abstract
  14. The Trivial File Transfer Protocol [1] is a simple, lock-step, file
  15. transfer protocol which allows a client to get or put a file onto a
  16. remote host. This document describes a simple extension to TFTP to
  17. allow option negotiation prior to the file transfer.
  18. Introduction
  19. The option negotiation mechanism proposed in this document is a
  20. backward-compatible extension to the TFTP protocol. It allows file
  21. transfer options to be negotiated prior to the transfer using a
  22. mechanism which is consistent with TFTPs Request Packet format. The
  23. mechanism is kept simple by enforcing a request-respond-acknowledge
  24. sequence, similar to the lock-step approach taken by TFTP itself.
  25. While the option negotiation mechanism is general purpose, in that
  26. many types of options may be negotiated, it was created to support
  27. the Blocksize option defined in [2]. Additional options are defined
  28. in [3].
  29. This document assumes reader familiarity with the TFTP specification
  30. [1] and its terminology.
  31. Packet Formats
  32. TFTP options are appended to the Read Request and Write Request
  33. packets. A new type of TFTP packet, the Option Acknowledgment
  34. (OACK), is used to acknowledge a client's option negotiation request.
  35. A new error code, 8, is hereby defined to indicate that a transfer
  36. should be terminated due to option negotiation.
  37. Malkin & Harkin [Page 1]
  38. RFC 1782 TFTP Option Extension March 1995
  39. Options are appended to a TFTP Read Request or Write Request packet
  40. as follows:
  41. +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+-->
  42. | opc |filename| 0 | mode | 0 | opt1 | 0 | value1 | 0 | <
  43. +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+-->
  44. >-------+---+---~~---+---+
  45. < optN | 0 | valueN | 0 |
  46. >-------+---+---~~---+---+
  47. The "0"s shown in these illustrations and the ones below are all
  48. all zero octets, i.e., NULL terminators for the preceeding
  49. fields.
  50. opc
  51. The opcode field contains either a 1, for Read Requests, or 2,
  52. for Write Requests, as defined in [1].
  53. filename
  54. The name of the file to be read or written, as defined in [1].
  55. This is a NULL-terminated field.
  56. mode
  57. The mode of the file transfer: "netascii", "octet", or "mail",
  58. as defined in [1]. This is a NULL-terminated field.
  59. opt1
  60. The first option, in case-insensitive ASCII (e.g., "blksize").
  61. This is a NULL-terminated ASCII field.
  62. value1
  63. The value associated with the first option, in case-insensitive
  64. ASCII. This is a NULL-terminated field.
  65. optN, valueN
  66. The final option/value pair. Each NULL-terminated field is
  67. specified in case-insensitive ASCII.
  68. The options and values are all NULL-terminated, in keeping with the
  69. original request format. If multiple options are to be negotiated,
  70. they are appended to each other. The order in which options are
  71. specified is not significant. The maximum size of a request packet
  72. is 512 octets.
  73. Malkin & Harkin [Page 2]
  74. RFC 1782 TFTP Option Extension March 1995
  75. The OACK packet has the following format:
  76. +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
  77. | opc | opt1 | 0 | value1 | 0 | optN | 0 | valueN | 0 |
  78. +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
  79. opc
  80. The opcode field contains a 6, for Option Acknowledgment.
  81. opt1
  82. The first option acknowledgment, copied from the original
  83. request.
  84. value1
  85. The acknowledged value associated with the first option. If
  86. and how this value may differ from the original request is
  87. detailed in the specification for the option.
  88. optN, valueN
  89. The final option/value acknowledgment pair.
  90. Negotiation Protocol
  91. The client appends options at the end of the Read Request or Write
  92. request packet, as shown above. Any number of options may be
  93. specified; however, an option may only be specified once. The order
  94. of the options is not significant.
  95. If the server supports option negotiation, and it recognizes one or
  96. more of the options specified in the request packet, the server may
  97. respond with an Options Acknowledgment (OACK). Each option the
  98. server recognizes, and accepts the value for, is included in the
  99. OACK. Some options may allow alternate values to be proposed, but
  100. this is an option specific feature. The server must not include in
  101. the OACK any option which had not been specifically requested by the
  102. client; that is, only the client may initiate option negotiation.
  103. Options which the server does not support should be omitted from the
  104. OACK; they must not cause an ERROR packet to be generated. If the
  105. value of a supported option is invalid, the specification for that
  106. option will indicate whether the server should simply omit the option
  107. from the OACK, respond with an alternate value, or send an ERROR
  108. packet, with error code 8, to terminate the transfer.
  109. An option not acknowledged by the server must be ignored by the
  110. client and server as if it were never requested. If multiple options
  111. were requested, the client must use those options which were
  112. acknowledged by the server and must not use those options which were
  113. not acknowledged by the server.
  114. Malkin & Harkin [Page 3]
  115. RFC 1782 TFTP Option Extension March 1995
  116. When the client appends options to the end of a Read Request packet,
  117. three possible responses may be returned by the server:
  118. OACK - acknowledge of Read Request and the options;
  119. DATA - acknowledge of Read Request, but not the options;
  120. ERROR - the request has been denied.
  121. When the client appends options to the end of a Write Request packet,
  122. three possible responses may be returned by the server:
  123. OACK - acknowledge of Write Request and the options;
  124. ACK - acknowledge of Write Request, but not the options;
  125. ERROR - the request has been denied.
  126. If a server implementation does not support option negotiation, it
  127. will likely ignore any options appended to the client's request. In
  128. this case, the server will return a DATA packet for a Read Request
  129. and an ACK packet for a Write Request establishing normal TFTP data
  130. transfer. In the event that a server returns an error for a request
  131. which carries an option, the client may attempt to repeat the request
  132. without appending any options. This implementation option would
  133. handle servers which consider extraneous data in the request packet
  134. to be erroneous.
  135. Depending on the original transfer request there are two ways for a
  136. client to confirm acceptance of a server's OACK. If the transfer was
  137. initiated with a Read Request, then an ACK (with the data block
  138. number set to 0) is sent by the client to confirm the values in the
  139. server's OACK packet. If the transfer was initiated with a Write
  140. Request, then the client begins the transfer with the first DATA
  141. packet, using the negotiated values. If the client rejects the OACK,
  142. then it sends an ERROR packet, with error code 8, to the server and
  143. the transfer is terminated.
  144. Once a client acknowledges an OACK, with an appropriate non-error
  145. response, that client has agreed to use only the options and values
  146. returned by the server. Remember that the server cannot request an
  147. option; it can only respond to them. If the client receives an OACK
  148. containing an unrequested option, it should respond with an ERROR
  149. packet, with error code 8, and terminate the transfer.
  150. Malkin & Harkin [Page 4]
  151. RFC 1782 TFTP Option Extension March 1995
  152. Examples
  153. Read Request
  154. client server
  155. -------------------------------------------------------
  156. |1|foofile|0|octet|0|blksize|0|1432|0| --> RRQ
  157. <-- |6|blksize|0|1432|0| OACK
  158. |4|0| --> ACK
  159. <-- |3|1| 1432 octets of data | DATA
  160. |4|1| --> ACK
  161. <-- |3|2| 1432 octets of data | DATA
  162. |4|2| --> ACK
  163. <-- |3|3|<1432 octets of data | DATA
  164. |4|3| --> ACK
  165. Write Request
  166. client server
  167. -------------------------------------------------------
  168. |2|barfile|0|octet|0|blksize|0|2048|0| --> RRQ
  169. <-- |6|blksize|0|2048|0| OACK
  170. |3|1| 2048 octets of data | --> DATA
  171. <-- |4|1| ACK
  172. |3|2| 2048 octets of data | --> DATA
  173. <-- |4|2| ACK
  174. |3|3|<2048 octets of data | --> DATA
  175. <-- |4|3| ACK
  176. Security Considerations
  177. Security issues are not discussed in this memo.
  178. References
  179. [1] Sollins, K., "The TFTP Protocol (Revision 2)", STD 33, RFC 1350,
  180. MIT, July 1992.
  181. [2] Malkin, G., and A. Harkin, "TFTP Blocksize Option", RFC 1783,
  182. Xylogics, Inc., Hewlett Packard Co., March 1995.
  183. [3] Malkin, G., and A. Harkin, A., "TFTP Timeout Interval and
  184. Transfer Size Options", RFC 1784, Xylogics, Inc., Hewlett Packard
  185. Co., March 1995.
  186. Malkin & Harkin [Page 5]
  187. RFC 1782 TFTP Option Extension March 1995
  188. Authors' Addresses
  189. Gary Scott Malkin
  190. Xylogics, Inc.
  191. 53 Third Avenue
  192. Burlington, MA 01803
  193. Phone: (617) 272-8140
  194. EMail: [email protected]
  195. Art Harkin
  196. Internet Services Project
  197. Information Networks Division
  198. 19420 Homestead Road MS 43LN
  199. Cupertino, CA 95014
  200. Phone: (408) 447-3755
  201. EMail: [email protected]
  202. Malkin & Harkin [Page 6]