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.

223 lines
7.6 KiB

  1. Network Working Group G. Malkin
  2. Request for Comments: 1783 Xylogics, Inc.
  3. Updates: 1350 A. Harkin
  4. Category: Standards Track Hewlett Packard Co.
  5. March 1995
  6. TFTP Blocksize Option
  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. One of its primary uses is the booting of diskless
  17. nodes on a Local Area Network. TFTP is used because it is very
  18. simple to implement in a small node's limited ROM space. However,
  19. the choice of a 512-byte blocksize is not the most efficient for use
  20. on a LAN whose MTU may 1500 bytes or greater.
  21. This document describes a TFTP option which allows the client and
  22. server to negotiate a blocksize more applicable to the network
  23. medium. The TFTP Option Extension mechanism is described in [2].
  24. Blocksize Option Specification
  25. The TFTP Read Request or Write Request packet is modified to include
  26. the blocksize option as follows:
  27. +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
  28. | opc |filename| 0 | mode | 0 | blksize| 0 | #octets| 0 |
  29. +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
  30. opc
  31. The opcode field contains either a 1, for Read Requests, or 2,
  32. for Write Requests, as defined in [1].
  33. filename
  34. The name of the file to be read or written, as defined in [1].
  35. This is a NULL-terminated field.
  36. Malkin & Harkin [Page 1]
  37. RFC 1783 TFTP Blocksize Option March 1995
  38. mode
  39. The mode of the file transfer: "netascii", "octet", or "mail",
  40. as defined in [1]. This is a NULL-terminated field.
  41. blksize
  42. The Blocksize option, "blksize" (case insensitive). This is a
  43. NULL-terminated field.
  44. #octets
  45. The number of octets in a block, specified in ASCII. Valid
  46. values range between "8" and "65464" octets, inclusive. This
  47. is a NULL-terminated field.
  48. For example:
  49. +-------+--------+---+--------+---+--------+---+--------+---+
  50. | 1 | foobar | 0 | binary | 0 | blksize| 0 | 1432 | 0 |
  51. +-------+--------+---+--------+---+--------+---+--------+---+
  52. is a Read Request, for the file named "foobar", in binary transfer
  53. mode, with a block size of 1432 bytes (Ethernet MTU, less the UDP and
  54. IP header lengths).
  55. If the server is willing to accept the blocksize option, it sends an
  56. Option Acknowledgment (OACK) to the client. The specified value must
  57. be less than or equal to the value specified by the client. The
  58. client must then either use the size specified in the OACK, or send
  59. an ERROR packet, with error code 8, to terminate the transfer.
  60. The rules for determining the final packet are unchanged from [1].
  61. The reception of a data packet with a data length less than the
  62. negotiated blocksize is the final packet. If the blocksize is
  63. greater than the size of the packet, the first packet is the final
  64. packet. If amount of data to be transfered is an integral multiple
  65. of the blocksize, an extra data packet containing no data is sent to
  66. end the transfer.
  67. Malkin & Harkin [Page 2]
  68. RFC 1783 TFTP Blocksize Option March 1995
  69. Proof of Concept
  70. Performance tests were run on the prototype implementation using a
  71. variety of block sizes. The tests were run on a lightly loaded
  72. Ethernet, between two HP-UX 9000, in "octet" mode, on 2.25MB files.
  73. The average (5x) transfer times for paths with (g-time) and without
  74. (n-time) a intermediate gateway are graphed as follows:
  75. |
  76. 37 + g
  77. |
  78. 35 +
  79. |
  80. 33 +
  81. |
  82. 31 +
  83. |
  84. 29 +
  85. |
  86. 27 +
  87. | g blocksize n-time g-time
  88. 25 + --------- ------ ------
  89. s | n 512 23.85 37.05
  90. e 23 + g 1024 16.15 25.65
  91. c | 1432 13.70 23.10
  92. o 21 + 2048 10.90 16.90
  93. n | 4096 6.85 9.65
  94. d 19 + 8192 4.90 6.15
  95. s |
  96. 17 + g
  97. | n
  98. 15 +
  99. | n
  100. 13 +
  101. |
  102. 11 + n
  103. | g
  104. 9 +
  105. |
  106. 7 + n
  107. | g
  108. 5 + n
  109. "
  110. 0 +------+------+--+---+------+------+---
  111. 512 1K | 2K 4K 8K
  112. 1432
  113. blocksize (bytes)
  114. Malkin & Harkin [Page 3]
  115. RFC 1783 TFTP Blocksize Option March 1995
  116. The comparisons between transfer times (without a gateway) between
  117. the standard 512-byte blocksize and the negotiated blocksizes are:
  118. 1024 2x -32%
  119. 1432 2.8x -42%
  120. 2048 4x -54%
  121. 4096 8x -71%
  122. 8192 16x -80%
  123. As was anticipated, the transfer time decreases with an increase in
  124. blocksize. The reason for the reduction in time is the reduction in
  125. the number of packets sent. For example, by increasing the blocksize
  126. from 512 bytes to 1024 bytes, not only are the number of data packets
  127. halved, but the number of acknowledgement packets is also halved
  128. (along with the number of times the data transmitter must wait for an
  129. ACK). A secondary effect is the efficiency gained by reducing the
  130. per-packet framing and processing overhead.
  131. Of course, if the blocksize exceeds the path MTU, IP fragmentation
  132. and reassembly will begin to add more overhead. This will be more
  133. noticable the greater the number of gateways in the path.
  134. Security Considerations
  135. Security issues are not discussed in this memo.
  136. References
  137. [1] Sollins, K., "The TFTP Protocol (Revision 2)", STD 33, RFC 1350,
  138. MIT, July 1992.
  139. [2] Malkin, G., and A. Harkin, "TFTP Option Extension", RFC 1782,
  140. Xylogics, Inc., Hewlett Packard Co., March 1995.
  141. Malkin & Harkin [Page 4]
  142. RFC 1783 TFTP Blocksize Option March 1995
  143. Authors' Addresses
  144. Gary Scott Malkin
  145. Xylogics, Inc.
  146. 53 Third Avenue
  147. Burlington, MA 01803
  148. Phone: (617) 272-8140
  149. EMail: [email protected]
  150. Art Harkin
  151. Internet Services Project
  152. Information Networks Division
  153. 19420 Homestead Road MS 43LN
  154. Cupertino, CA 95014
  155. Phone: (408) 447-3755
  156. EMail: [email protected]
  157. Malkin & Harkin [Page 5]