rfc-7440

TFTP Windowsize Option

P. Masotta
date2015-01 streamIETF wgnon working group statusPROPOSED STANDARD pages9 canonicalhttps://www.rfc-editor.org/rfc/rfc7440 doi10.17487/RFC7440
The "Trivial File Transfer Protocol" (RFC 1350) 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" (RFC 2347).

Extracted elements (19)

design-rationale §6

The appropriate windowsize depends on underlying networking technology and topology. Rather than mandating a fixed value, the extension allows negotiation so operators can tune for their environment. The example configuration (windowsize=8, blksize=1456, 6 max retries, 1s timeout, 80µs inter-packet delay) is scaled for a 1 Gbit/s Ethernet environment.

realtime

design-rationale §5

The windowed scheme dramatically reduces transfer time by reducing the number of synchronous acknowledgements exchanged. Measurements on Gigabit Ethernet showed a windowsize of 4 reduced transfer time by 70%, windowsize 16 by 84%, and windowsize 64 by 86% compared to the lockstep (windowsize 1) baseline, motivating the extension over the existing blocksize-only optimization.

realtime

interoperability-note §3

The rules for determining the final packet are unchanged from RFC 1350 and RFC 2348; only the window transmission and acknowledgment flow is modified by this extension.

realtime

interoperability-note §3

The windowsize option is negotiated using the TFTP Option Extension mechanism defined in RFC 2347. If the server does not support the option it will ignore it, and the transfer proceeds as standard lockstep TFTP per RFC 1350, ensuring backward compatibility with non-implementing servers.

realtime

normative-requirement §3 MUST

If the server accepts the windowsize option, it sends an OACK whose specified value MUST be less than or equal to the value specified by the client.

realtime

normative-requirement §6 SHOULD

Implementations SHOULD always set a maximum number of retries for datagram retransmissions, and after reaching that threshold a transfer SHOULD always be aborted to prevent pathological retransmission conditions.

realtime

normative-requirement §4 SHOULD

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, and the DSND SHOULD send a new window whose beginning MUST be set based on the out-of-sequence ACK received.

realtime

normative-requirement §4 RECOMMENDED

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.

realtime

normative-requirement §5 SHOULD

Operators SHOULD test various windowsize values and SHOULD be conservative when selecting a windowsize value because beyond a certain point the benefit of increasing the windowsize is subject to diminishing returns.

realtime

normative-requirement §4 MUST

The Data Receiver (DRCV) MUST send to the DSND the ACK of the last data block of the window in order to confirm successful receipt of the data block window.

realtime

normative-requirement §4 MUST

The Data Sender (DSND) MUST cyclically send the agreed windowsize consecutive data blocks before stopping and waiting for the ACK of the transferred window.

realtime

normative-requirement §6 SHOULD

The rate at which TFTP UDP datagrams are sent SHOULD follow the congestion control guidelines in Section 3.1 of RFC 5405 (Unicast UDP Usage Guidelines).

realtime, congestion, udp

normative-requirement §4 MUST

Traffic with windowsize = 1 MUST be equivalent to traffic specified by RFC 1350, preserving backward compatibility with the original lockstep TFTP protocol.

realtime

normative-requirement §3 MUST

Upon receiving an OACK, the client MUST either use the size specified in the OACK or send an ERROR packet with error code 8 to terminate the transfer.

realtime

protocol-element §3

The '#blocks' field specifies the number of consecutive blocks in a window. Valid values MUST be between 1 and 65535 blocks inclusive. The windowsize refers to the number of consecutive blocks transmitted before stopping and waiting for acknowledgment of the last block transmitted.

realtime

protocol-element §3

The reception of a data window with fewer blocks than the negotiated windowsize signals the final window. If the windowsize exceeds the total data to transfer, the first window is also the final window.

realtime

security-consideration §7

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, as those services must be supplied above or below the TFTP layer. TFTP file transfers are NOT RECOMMENDED where inherent protocol limitations could raise insurmountable liability concerns.

security, realtime

security-consideration §7

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. The windowsize extension itself does not pose additional security risks beyond those already present in TFTP.

security, realtime

wire-format §3

The TFTP Read Request or Write Request packet is extended with two new NULL-terminated ASCII fields appended after the mode field: the literal string 'windowsize' (case insensitive) and the #blocks value as a base-10 ASCII string. All fields except the 2-byte 'opc' field MUST be ASCII strings followed by a single-byte NULL character.

realtime