| 1 |
<pre>Network Working Group G. Malkin |
| 2 |
Request for Comments: 1783 Xylogics, Inc. |
| 3 |
Updates: <a href="./rfc1350">1350</a> A. Harkin |
| 4 |
Category: Standards Track Hewlett Packard Co. |
| 5 |
March 1995 |
| 6 |
|
| 7 |
|
| 8 |
<span class="h1">TFTP Blocksize Option</span> |
| 9 |
|
| 10 |
Status of this Memo |
| 11 |
|
| 12 |
This document specifies an Internet standards track protocol for the |
| 13 |
Internet community, and requests discussion and suggestions for |
| 14 |
improvements. Please refer to the current edition of the "Internet |
| 15 |
Official Protocol Standards" (STD 1) for the standardization state |
| 16 |
and status of this protocol. Distribution of this memo is unlimited. |
| 17 |
|
| 18 |
Abstract |
| 19 |
|
| 20 |
The Trivial File Transfer Protocol [<a href="#ref-1" title=""The TFTP Protocol (Revision 2)"">1</a>] is a simple, lock-step, file |
| 21 |
transfer protocol which allows a client to get or put a file onto a |
| 22 |
remote host. One of its primary uses is the booting of diskless |
| 23 |
nodes on a Local Area Network. TFTP is used because it is very |
| 24 |
simple to implement in a small node's limited ROM space. However, |
| 25 |
the choice of a 512-byte blocksize is not the most efficient for use |
| 26 |
on a LAN whose MTU may 1500 bytes or greater. |
| 27 |
|
| 28 |
This document describes a TFTP option which allows the client and |
| 29 |
server to negotiate a blocksize more applicable to the network |
| 30 |
medium. The TFTP Option Extension mechanism is described in [<a href="#ref-2" title=""TFTP Option Extension"">2</a>]. |
| 31 |
|
| 32 |
Blocksize Option Specification |
| 33 |
|
| 34 |
The TFTP Read Request or Write Request packet is modified to include |
| 35 |
the blocksize option as follows: |
| 36 |
|
| 37 |
+-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+ |
| 38 |
| opc |filename| 0 | mode | 0 | blksize| 0 | #octets| 0 | |
| 39 |
+-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+ |
| 40 |
|
| 41 |
opc |
| 42 |
The opcode field contains either a 1, for Read Requests, or 2, |
| 43 |
for Write Requests, as defined in [<a href="#ref-1" title=""The TFTP Protocol (Revision 2)"">1</a>]. |
| 44 |
|
| 45 |
filename |
| 46 |
The name of the file to be read or written, as defined in [<a href="#ref-1" title=""The TFTP Protocol (Revision 2)"">1</a>]. |
| 47 |
This is a NULL-terminated field. |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
<span class="grey">Malkin & Harkin [Page 1]</span></pre> |
| 53 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span> |
| 54 |
<span class="grey"><a href="./rfc1783">RFC 1783</a> TFTP Blocksize Option March 1995</span> |
| 55 |
|
| 56 |
|
| 57 |
mode |
| 58 |
The mode of the file transfer: "netascii", "octet", or "mail", |
| 59 |
as defined in [<a href="#ref-1" title=""The TFTP Protocol (Revision 2)"">1</a>]. This is a NULL-terminated field. |
| 60 |
|
| 61 |
blksize |
| 62 |
The Blocksize option, "blksize" (case insensitive). This is a |
| 63 |
NULL-terminated field. |
| 64 |
|
| 65 |
#octets |
| 66 |
The number of octets in a block, specified in ASCII. Valid |
| 67 |
values range between "8" and "65464" octets, inclusive. This |
| 68 |
is a NULL-terminated field. |
| 69 |
|
| 70 |
For example: |
| 71 |
|
| 72 |
+-------+--------+---+--------+---+--------+---+--------+---+ |
| 73 |
| 1 | foobar | 0 | binary | 0 | blksize| 0 | 1432 | 0 | |
| 74 |
+-------+--------+---+--------+---+--------+---+--------+---+ |
| 75 |
|
| 76 |
is a Read Request, for the file named "foobar", in binary transfer |
| 77 |
mode, with a block size of 1432 bytes (Ethernet MTU, less the UDP and |
| 78 |
IP header lengths). |
| 79 |
|
| 80 |
If the server is willing to accept the blocksize option, it sends an |
| 81 |
Option Acknowledgment (OACK) to the client. The specified value must |
| 82 |
be less than or equal to the value specified by the client. The |
| 83 |
client must then either use the size specified in the OACK, or send |
| 84 |
an ERROR packet, with error code 8, to terminate the transfer. |
| 85 |
|
| 86 |
The rules for determining the final packet are unchanged from [<a href="#ref-1" title=""The TFTP Protocol (Revision 2)"">1</a>]. |
| 87 |
The reception of a data packet with a data length less than the |
| 88 |
negotiated blocksize is the final packet. If the blocksize is |
| 89 |
greater than the size of the packet, the first packet is the final |
| 90 |
packet. If amount of data to be transfered is an integral multiple |
| 91 |
of the blocksize, an extra data packet containing no data is sent to |
| 92 |
end the transfer. |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
<span class="grey">Malkin & Harkin [Page 2]</span></pre> |
| 109 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span> |
| 110 |
<span class="grey"><a href="./rfc1783">RFC 1783</a> TFTP Blocksize Option March 1995</span> |
| 111 |
|
| 112 |
|
| 113 |
Proof of Concept |
| 114 |
|
| 115 |
Performance tests were run on the prototype implementation using a |
| 116 |
variety of block sizes. The tests were run on a lightly loaded |
| 117 |
Ethernet, between two HP-UX 9000, in "octet" mode, on 2.25MB files. |
| 118 |
The average (5x) transfer times for paths with (g-time) and without |
| 119 |
(n-time) a intermediate gateway are graphed as follows: |
| 120 |
|
| 121 |
| |
| 122 |
37 + g |
| 123 |
| |
| 124 |
35 + |
| 125 |
| |
| 126 |
33 + |
| 127 |
| |
| 128 |
31 + |
| 129 |
| |
| 130 |
29 + |
| 131 |
| |
| 132 |
27 + |
| 133 |
| g blocksize n-time g-time |
| 134 |
25 + --------- ------ ------ |
| 135 |
s | n 512 23.85 37.05 |
| 136 |
e 23 + g 1024 16.15 25.65 |
| 137 |
c | 1432 13.70 23.10 |
| 138 |
o 21 + 2048 10.90 16.90 |
| 139 |
n | 4096 6.85 9.65 |
| 140 |
d 19 + 8192 4.90 6.15 |
| 141 |
s | |
| 142 |
17 + g |
| 143 |
| n |
| 144 |
15 + |
| 145 |
| n |
| 146 |
13 + |
| 147 |
| |
| 148 |
11 + n |
| 149 |
| g |
| 150 |
9 + |
| 151 |
| |
| 152 |
7 + n |
| 153 |
| g |
| 154 |
5 + n |
| 155 |
" |
| 156 |
0 +------+------+--+---+------+------+--- |
| 157 |
512 1K | 2K 4K 8K |
| 158 |
1432 |
| 159 |
blocksize (bytes) |
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
<span class="grey">Malkin & Harkin [Page 3]</span></pre> |
| 165 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span> |
| 166 |
<span class="grey"><a href="./rfc1783">RFC 1783</a> TFTP Blocksize Option March 1995</span> |
| 167 |
|
| 168 |
|
| 169 |
The comparisons between transfer times (without a gateway) between |
| 170 |
the standard 512-byte blocksize and the negotiated blocksizes are: |
| 171 |
|
| 172 |
1024 2x -32% |
| 173 |
1432 2.8x -42% |
| 174 |
2048 4x -54% |
| 175 |
4096 8x -71% |
| 176 |
8192 16x -80% |
| 177 |
|
| 178 |
As was anticipated, the transfer time decreases with an increase in |
| 179 |
blocksize. The reason for the reduction in time is the reduction in |
| 180 |
the number of packets sent. For example, by increasing the blocksize |
| 181 |
from 512 bytes to 1024 bytes, not only are the number of data packets |
| 182 |
halved, but the number of acknowledgement packets is also halved |
| 183 |
(along with the number of times the data transmitter must wait for an |
| 184 |
ACK). A secondary effect is the efficiency gained by reducing the |
| 185 |
per-packet framing and processing overhead. |
| 186 |
|
| 187 |
Of course, if the blocksize exceeds the path MTU, IP fragmentation |
| 188 |
and reassembly will begin to add more overhead. This will be more |
| 189 |
noticable the greater the number of gateways in the path. |
| 190 |
|
| 191 |
Security Considerations |
| 192 |
|
| 193 |
Security issues are not discussed in this memo. |
| 194 |
|
| 195 |
References |
| 196 |
|
| 197 |
[<a id="ref-1">1</a>] Sollins, K., "The TFTP Protocol (Revision 2)", STD 33, <a href="./rfc1350">RFC 1350</a>, |
| 198 |
MIT, July 1992. |
| 199 |
|
| 200 |
[<a id="ref-2">2</a>] Malkin, G., and A. Harkin, "TFTP Option Extension", <a href="./rfc1782">RFC 1782</a>, |
| 201 |
Xylogics, Inc., Hewlett Packard Co., March 1995. |
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
<span class="grey">Malkin & Harkin [Page 4]</span></pre> |
| 221 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span> |
| 222 |
<span class="grey"><a href="./rfc1783">RFC 1783</a> TFTP Blocksize Option March 1995</span> |
| 223 |
|
| 224 |
|
| 225 |
Authors' Addresses |
| 226 |
|
| 227 |
Gary Scott Malkin |
| 228 |
Xylogics, Inc. |
| 229 |
53 Third Avenue |
| 230 |
Burlington, MA 01803 |
| 231 |
|
| 232 |
Phone: (617) 272-8140 |
| 233 |
EMail: [email protected] |
| 234 |
|
| 235 |
|
| 236 |
Art Harkin |
| 237 |
Internet Services Project |
| 238 |
Information Networks Division |
| 239 |
19420 Homestead Road MS 43LN |
| 240 |
Cupertino, CA 95014 |
| 241 |
|
| 242 |
Phone: (408) 447-3755 |
| 243 |
EMail: [email protected] |
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
Malkin & Harkin [Page 5] |
| 277 |
</pre> |