1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 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 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
|
<pre>Internet Engineering Task Force (IETF) P. Masotta
Request for Comments: 7440 Serva
Category: Standards Track January 2015
ISSN: 2070-1721
<span class="h1">TFTP Windowsize Option</span>
Abstract
The "Trivial File Transfer Protocol" (<a href="./rfc1350">RFC 1350</a>) is a simple,
lockstep, file transfer protocol that allows a client to get or put a
file onto a remote host. One of its primary uses is in the early
stages of nodes booting from a Local Area Network (LAN). TFTP has
been used for this application because it is very simple to
implement. The employment of a lockstep scheme limits throughput
when used on a LAN.
This document describes a TFTP option that allows the client and
server to negotiate a window size of consecutive blocks to send as an
alternative for replacing the single-block lockstep schema. The TFTP
option mechanism employed is described in "TFTP Option Extension"
(<a href="./rfc2347">RFC 2347</a>).
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="http://www.rfc-editor.org/info/rfc7440">http://www.rfc-editor.org/info/rfc7440</a>.
<span class="grey">Masotta Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc7440">RFC 7440</a> TFTP Windowsize Option January 2015</span>
Copyright Notice
Copyright (c) 2015 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-2">2</a>
<a href="#section-2">2</a>. Conventions Used in This Document ...............................<a href="#page-3">3</a>
<a href="#section-3">3</a>. Windowsize Option Specification .................................<a href="#page-3">3</a>
<a href="#section-4">4</a>. Traffic Flow and Error Handling .................................<a href="#page-4">4</a>
<a href="#section-5">5</a>. Proof of Concept and Windowsize Evaluation ......................<a href="#page-6">6</a>
<a href="#section-6">6</a>. Congestion and Error Control ....................................<a href="#page-7">7</a>
<a href="#section-7">7</a>. Security Considerations .........................................<a href="#page-8">8</a>
<a href="#section-8">8</a>. References ......................................................<a href="#page-9">9</a>
<a href="#section-8.1">8.1</a>. Normative References .......................................<a href="#page-9">9</a>
Author's Address ...................................................<a href="#page-9">9</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
TFTP is virtually unused for Internet transfers today, TFTP is still
massively used in network boot/installation scenarios including EFI
(Extensible Firmware Interface). TFTP's inherently low transfer rate
has been, so far, partially mitigated by the use of the blocksize
negotiated extension [<a href="./rfc2348" title=""TFTP Blocksize Option"">RFC2348</a>]. Using this method, the original
limitation of 512-byte blocks are, in practice, replaced in Ethernet
environments by blocks no larger than 1468 Bytes to avoid IP block
fragmentation. This strategy produces insufficient results when
transferring big files, for example, the initial ramdisk of Linux
distributions or the PE images used in network installations by
Microsoft WDS/MDT/SCCM. Considering TFTP looks far from extinction
today, this document presents a negotiated extension, under the terms
of the "TFTP Option Extension" [<a href="./rfc2347" title=""TFTP Option Extension"">RFC2347</a>], that produces TFTP transfer
rates comparable to those achieved by modern file transfer protocols.
<span class="grey">Masotta Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc7440">RFC 7440</a> TFTP Windowsize Option January 2015</span>
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Conventions Used in This Document</span>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
[<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
In this document, these words will appear with that interpretation
only when in ALL CAPS. Lowercase uses of these words are not to be
interpreted as carrying the significance given in <a href="./rfc2119">RFC 2119</a>.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Windowsize Option Specification</span>
The TFTP Read Request or Write Request packet is modified to include
the windowsize option as follows. Note that all fields except "opc"
MUST be ASCII strings followed by a single-byte NULL character.
2B string 1B string 1B string 1B string 1B
+-------+---~~---+----+---~~---+----+-----~~-----+----+---~~---+----+
| opc |filename| 0 | mode | 0 | windowsize | 0 | #blocks| 0 |
+-------+---~~---+----+---~~---+----+-----~~-----+----+---~~---+----+
opc
The opcode field contains either a 1 for Read Requests or a 2 for
Write Requests, as defined in [<a href="./rfc1350" title=""The TFTP Protocol (Revision 2)"">RFC1350</a>].
filename
The name of the file to be read or written, as defined in
[<a href="./rfc1350" title=""The TFTP Protocol (Revision 2)"">RFC1350</a>].
mode
The mode of the file transfer: "netascii", "octet", or "mail", as
defined in [<a href="./rfc1350" title=""The TFTP Protocol (Revision 2)"">RFC1350</a>].
windowsize
The windowsize option, "windowsize" (case insensitive).
#blocks
The base-10 ASCII string representation of the number of blocks in
a window. The valid values range MUST be between 1 and 65535
blocks, inclusive. The windowsize refers to the number of
consecutive blocks transmitted before stopping and waiting for the
reception of the acknowledgment of the last block transmitted.
<span class="grey">Masotta Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc7440">RFC 7440</a> TFTP Windowsize Option January 2015</span>
For example:
+------+--------+----+-------+----+------------+----+----+----+
|0x0001| foobar |0x00| octet |0x00| windowsize |0x00| 16 |0x00|
+------+--------+----+-------+----+------------+----+----+----+
is a Read Request for the file named "foobar" in octet transfer mode
with a windowsize of 16 blocks (option blocksize is not negotiated in
this example, the default of 512 Bytes per block applies).
If the server is willing to accept the windowsize option, it sends an
Option Acknowledgment (OACK) to the client. The specified value MUST
be less than or equal to the value specified by the client. The
client MUST then either use the size specified in the OACK or send an
ERROR packet, with error code 8, to terminate the transfer.
The rules for determining the final packet are unchanged from
[<a href="./rfc1350" title=""The TFTP Protocol (Revision 2)"">RFC1350</a>] and [<a href="./rfc2348" title=""TFTP Blocksize Option"">RFC2348</a>].
The reception of a data window with a number of blocks less than the
negotiated windowsize is the final window. If the windowsize is
greater than the amount of data to be transferred, the first window
is the final window.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Traffic Flow and Error Handling</span>
The next diagram depicts a section of the traffic flow between the
Data Sender (DSND) and the Data Receiver (DRCV) parties on a generic
windowsize TFTP file transfer.
The DSND MUST cyclically send to the DRCV the agreed windowsize
consecutive data blocks before normally stopping and waiting for the
ACK of the transferred window. The DRCV MUST send to the DSND the
ACK of the last data block of the window in order to confirm a
successful data block window reception.
In the case of an expected ACK not timely reaching the DSND
(timeout), the last received ACK SHALL set the beginning of the next
windowsize data block window to be sent.
In the case of a data block sequence error, the DRCV SHOULD notify
the DSND by sending an ACK corresponding to the last data block
correctly received. The notified DSND SHOULD send a new data block
window whose beginning MUST be set based on the ACK received out of
sequence.
Traffic with windowsize = 1 MUST be equivalent to traffic specified
by [<a href="./rfc1350" title=""The TFTP Protocol (Revision 2)"">RFC1350</a>].
<span class="grey">Masotta Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc7440">RFC 7440</a> TFTP Windowsize Option January 2015</span>
For normative traffic not specifically addressed in this section,
please refer to [<a href="./rfc1350" title=""The TFTP Protocol (Revision 2)"">RFC1350</a>] and its updates.
[ DRCV ] <---traffic---> [ DSND ]
ACK# -> <- Data Block# window block#
...
<- |DB n+01| 1
<- |DB n+02| 2
<- |DB n+03| 3
<- |DB n+04| 4
|ACK n+04| ->
<- |DB n+05| 1
Error |<- |DB n+06| 2
<- |DB n+07| 3
|ACK n+05| ->
<- |DB n+06| 1
<- |DB n+07| 2
<- |DB n+08| 3
<- |DB n+09| 4
|ACK n+09| ->
<- |DB n+10| 1
Error |<- |DB n+11| 2
<- |DB n+12| 3
|ACK n+10| ->| Error
<- |DB n+13| 4
- timeout -
<- |DB n+10| 1
<- |DB n+11| 2
<- |DB n+12| 3
<- |DB n+13| 4
|ACK n+13| ->
...
Section of a Windowsize = 4 TFTP Transfer
Including Errors and Error Recovery
<span class="grey">Masotta Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc7440">RFC 7440</a> TFTP Windowsize Option January 2015</span>
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Proof of Concept and Windowsize Evaluation</span>
Performance tests were run on the prototype implementation using a
variety of windowsizes and a fixed blocksize of 1456 bytes. The
tests were run on a lightly loaded Gigabit Ethernet, between two
Toshiba Tecra Core 2 Duo 2.2 Ghz laptops, in "octet" mode,
transferring a 180 MByte file.
^
|
300 +
Seconds | windowsize | time (s)
| ---------- ------
| x 1 257
250 + 2 131
| 4 76
| 8 54
| 16 42
200 + 32 38
| 64 35
|
|
150 +
|
| x
|
100 +
|
| x
|
50 + x
| x
| x x
|
0 +-//--+-----+-----+-----+-----+-----+-----+-->
1 2 4 8 16 32 64
Windowsize (in Blocks of 1456 Bytes)
Comparatively, the same 180 MB transfer performed over a drive mapped
on Server Message Block (SMB) / Common Internet File System (CIFS) on
the same scenario took 23 seconds.
<span class="grey">Masotta Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc7440">RFC 7440</a> TFTP Windowsize Option January 2015</span>
The comparison of transfer times (without a gateway) between the
standard lockstep schema and the negotiated windowsizes are:
Windowsize | Time Reduction (%)
---------- -----------------
1 -0%
2 -49%
4 -70%
8 -79%
16 -84%
32 -85%
64 -86%
The transfer time decreases with the use of a windowed schema. The
reason for the reduction in time is the reduction in the number of
the required synchronous acknowledgements exchanged.
The choice of appropriate windowsize values on a particular scenario
depends on the underlying networking technology and topology, and
likely other factors as well. Operators SHOULD test various values
and SHOULD be conservative when selecting a windowsize value because
as the former table and chart shows, there is a point where the
benefit of continuing to increase the windowsize is subject to
diminishing returns.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Congestion and Error Control</span>
From a congestion control (CC) standpoint, the number of blocks in a
window does not pose an intrinsic threat to the ability of
intermediate devices to signal congestion through drops. The rate at
which TFTP UDP datagrams are sent SHOULD follow the CC guidelines in
<a href="./rfc5405#section-3.1">Section 3.1 of [RFC5405]</a>.
From an error control standpoint, while [<a href="./rfc1350" title=""The TFTP Protocol (Revision 2)"">RFC1350</a>] and subsequent
updates do not specify a circuit breaker (CB), existing
implementations have always chosen to fail under certain
circumstances. Implementations SHOULD always set a maximum number of
retries for datagram retransmissions, imposing an appropriate
threshold on error recovery attempts, after which a transfer SHOULD
always be aborted to prevent pathological retransmission conditions.
<span class="grey">Masotta Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc7440">RFC 7440</a> TFTP Windowsize Option January 2015</span>
An implementation example scaled for an Ethernet environment
(1 Gbit/s, MTU=1500) would be to set:
windowsize = 8
blksize = 1456
maximum retransmission attempts per block/window = 6
timeout between retransmissions = 1 S
minimum inter-packet delay = 80 uS
Implementations might well choose other values based on expected
and/or tested operating conditions.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Security Considerations</span>
TFTP includes no login or access control mechanisms. Care must be
taken when using TFTP for file transfers where authentication, access
control, confidentiality, or integrity checking are needed. Note
that those security services could be supplied above or below the
layer at which TFTP runs. Care must also be taken in the rights
granted to a TFTP server process so as not to violate the security of
the server's file system. TFTP is often installed with controls such
that only files that have public read access are available via TFTP.
Also listing, deleting, renaming, and writing files via TFTP are
typically disallowed. TFTP file transfers are NOT RECOMMENDED where
the inherent protocol limitations could raise insurmountable
liability concerns.
TFTP includes no protection against an on-path attacker; care must be
taken in controlling windowsize values according to data sender, data
receiver, and network environment capabilities. TFTP service is
frequently associated with bootstrap and initial provisioning
activities; servers in such an environment are in a position to
impose device or network specific throughput limitations as
appropriate.
This document does not add any security controls to TFTP; however,
the specified extension does not pose additional security risks
either.
<span class="grey">Masotta Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc7440">RFC 7440</a> TFTP Windowsize Option January 2015</span>
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. References</span>
<span class="h3"><a class="selflink" id="section-8.1" href="#section-8.1">8.1</a>. Normative References</span>
[<a id="ref-RFC1350">RFC1350</a>] Sollins, K., "The TFTP Protocol (Revision 2)", STD 33,
<a href="./rfc1350">RFC 1350</a>, July 1992,
<<a href="http://www.rfc-editor.org/info/rfc1350">http://www.rfc-editor.org/info/rfc1350</a>>.
[<a id="ref-RFC2347">RFC2347</a>] Malkin, G. and A. Harkin, "TFTP Option Extension", <a href="./rfc2347">RFC</a>
<a href="./rfc2347">2347</a>, May 1998, <<a href="http://www.rfc-editor.org/info/rfc2347">http://www.rfc-editor.org/info/rfc2347</a>>.
[<a id="ref-RFC2348">RFC2348</a>] Malkin, G. and A. Harkin, "TFTP Blocksize Option", <a href="./rfc2348">RFC</a>
<a href="./rfc2348">2348</a>, May 1998, <<a href="http://www.rfc-editor.org/info/rfc2348">http://www.rfc-editor.org/info/rfc2348</a>>.
[<a id="ref-RFC5405">RFC5405</a>] Eggert, L. and G. Fairhurst, "Unicast UDP Usage
Guidelines for Application Designers", <a href="https://www.rfc-editor.org/bcp/bcp145">BCP 145</a>, <a href="./rfc5405">RFC 5405</a>,
November 2008, <<a href="http://www.rfc-editor.org/info/rfc5405">http://www.rfc-editor.org/info/rfc5405</a>>.
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997,
<<a href="http://www.rfc-editor.org/info/rfc2119">http://www.rfc-editor.org/info/rfc2119</a>>.
Author's Address
Patrick Masotta
Serva
EMail: patrick.masotta.ietf@vercot.com
URI: <a href="http://www.vercot.com/~serva/">http://www.vercot.com/~serva/</a>
Masotta Standards Track [Page 9]
</pre>
|